Hi,

Have you gone through the prerequisites 
<https://developers.google.com/adwords/api/docs/guides/service-accounts#prereqs>
 for 
Service Accounts? Also, almost everyone we talk to who is interested in 
using a Service Account finds that they can actually just use the web or 
installed application flows for their use case, as mentioned in the *An 
alternative to service accounts 
<https://developers.google.com/adwords/api/docs/guides/service-accounts#alt>* 
section 
of our OAuth Service Accounts guide.

Thanks,
Josh, AdWords API Team

On Friday, August 1, 2014 1:31:36 PM UTC-4, awan wrote:
>
> Hi,
> The project I have in developer console is a "Service Account". I am 
> getting the following exception while executing this .Net code to grant 
> access to AdWords API, the exception happened at the last line of my code. 
> Can you help me point out what I am missing? I am coding with v201406 .Net 
> API library.  Thanks
>
> Failed to get access token for service account.
> {
>   "error" : "invalid_grant"
> }
>
> Sub GetToken()
>         Private config As AdWordsAppConfig
>         Private user As AdWordsUser
>
>         user = New AdWordsUser()
>         config = user.Config
>
>         config.OAuth2ClientId = {The Client ID from Project -> Credentials 
> -> CLIENT ID}
>         config.OAuth2ServiceAccountEmail = {email address of my account}
>         config.OAuth2PrnEmail = {The Client ID from Project -> Credentials 
> -> EMAIL ADDRESS}
>         config.DeveloperToken = {My developer Token}
>         config.OAuth2CertificatePath = {Local file path to my p12 
> certificate, download from console when I created my P12 key}
>         config.OAuth2CertificatePassword = "notasecret"
>         config.OAuth2Mode = OAuth2Flow.SERVICE_ACCOUNT
>         config.AuthorizationMethod = AdWordsAuthorizationMethod.OAuth2
>         user.Config.OAuth2Scope = "https://adwords.google.com/api/adwords/
> "
>
>         Dim auth As New OAuth2ProviderForServiceAccounts(config)
>         Dim rpt As ReportDefinitionService = 
> user.GetService(AdWordsService.v201406.ReportDefinitionService)
>         auth.GenerateAccessTokenForServiceAccount()
> End Sub
>
> Thank you
>
> Aroma
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to