MCC OAuth Long Lived Token Generation for Reporting

192 views
Skip to first unread message

okieb...@gmail.com

unread,
Nov 11, 2011, 2:05:38 PM11/11/11
to AdWords API Forum
While attending the API WorkShop in NYC, one of the Google team was
discussing a method for returning a long lived access token for the
AdWords API scope, to use for Reporting. One could then store in DB
and present in place of the OAuth "dance" flow to obtain the token.
I've gone through the workshop material and am unable to locate the
URL's for the generation of this token.

If you could please outline this process, it would be most
appreciated.

David

Kevin Winter

unread,
Nov 14, 2011, 11:10:00 AM11/14/11
to adwor...@googlegroups.com
Hi David,
  The client libraries (except for java) have published code examples showing how to use the libraries to do this.  For example, see here for python: http://code.google.com/p/google-api-ads-python/source/browse/trunk/examples/adspygoogle/adwords/other/use_oauth.py

We published a blog post talking about OAuth in general here: http://adwordsapi.blogspot.com/2011/10/adwords-api-now-fully-supports-oauth.html

It links to this page which covers the OAuth process with Google in detail: http://code.google.com/apis/accounts/docs/OAuth.html

- Kevin Winter
AdWords API Team

okieb...@gmail.com

unread,
Nov 15, 2011, 7:06:38 AM11/15/11
to adwor...@googlegroups.com
Thanks for the reply Kevin.  I've reviewed the docs you've referenced, and could not find the method to generate a long-lived access token - one that does not require continued refresh token exchanges.  I was looking for an interactive panel to perform the OAuth2 dance; after completing I would have a long lived access token.  I could then use this token for my future Reporting API access.

I'll begin experimentation with my custom application (do not use the client libraries) using "grant_type "password" in the OAuth2 dance steps and see how this plays out.  I found this information at the OAuth2 documentation site: http://tools.ietf.org/html/draft-ietf-oauth-v2-22 in section 4.3.2.

David
 



Kevin Winter

unread,
Nov 15, 2011, 9:48:52 AM11/15/11
to adwor...@googlegroups.com
Hi David,
  OAuth2 does not have long-lived OAuth tokens.  It has short-lived access tokens that can be refreshed using the refresh token as needed.  OAuth 1 does allow for long-lived access tokens.  Note that we've not yet tested OAuth2 support with the AdWords API.

The OAuth playground may be able to help you test your implementation: http://googlecodesamples.com/oauth_playground/

- Kevin Winter
AdWords API Team

okieb...@gmail.com

unread,
Nov 15, 2011, 9:54:46 AM11/15/11
to adwor...@googlegroups.com
Thanks for the confirmation, explains my issues with OAuth2 and long lived tokens.
Reply all
Reply to author
Forward
0 new messages