Hi Martin,

There is no direct support in the Ruby library to generate JWT access 
tokens (the tokens used by service accounts), please log a feature request 
in their project issue 
tracker<http://code.google.com/p/google-api-ads-ruby/issues/list>
.

For Java, you have to do something along these lines:

GoogleCredential credential = new 
GoogleCredential.Builder().setTransport(new NetHttpTransport())
   .setJsonFactory(new GsonFactory())
   .setServiceAccountId(SERVICE_ACCOUNT_EMAIL)
   .setServiceAccountScopes(SCOPE)
   .setServiceAccountPrivateKeyFromP12File(new File(PATH_TO_YOUR_P12_FILE))
   .setServiceAccountUser(SERVICE_ACCOUNT_TARGET_EMAIL)
   .build();    

Best,

-David Torres - AdWords API Team

On Thursday, October 4, 2012 9:37:55 AM UTC-4, Marcin Urbanski wrote:
>
> Hi all.
>
> Is there a way to use OAuth 2.0 for Server to Server Applications using 
> Ruby library?
> I couldn't find anything in the source code.
>
> https://developers.google.com/accounts/docs/OAuth2ServiceAccount
>
> Can you eventually show me an example of how to use this kind of 
> authentication (without user) in Java maybe?
> I did a lot of research today but the only examples I could find are 
> broken C# snippets and Java examples that require
> user activity:( I have to connect to AdWords API through OAuth 2 to avoid 
> AdsCommon::Errors::CaptchaRequiredError 
> exceptions.
>
> I need something like this
>
>
> http://stackoverflow.com/questions/11939026/google-oauth2-service-account-access-token-request-gives-invalid-request-respo/11942278#11942278
>
> Thanks!
> Martin
>

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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

Reply via email to