Re: Authorization Method

452 views
Skip to first unread message

Anash P. Oommen (AdWords API Team)

unread,
Jan 28, 2013, 12:47:59 AM1/28/13
to adwor...@googlegroups.com
Hi Marcos,

May I know why the use of ClientLogin isn't an option? You could use email/password of the test account to test your script, and once the development is done, you could substitute your production account credentials instead. This way you don't have to use live credentials in your script in the development phase.

Also, if you want to start using OAuth2 instead of ClientLogin, then PHP library has a code example that explains how this may be done. See http://code.google.com/p/google-api-adwords-php/source/browse/examples/v201209/Misc/UseOAuth2.php for details.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Tuesday, January 22, 2013 11:19:52 PM UTC+5:30, Marcos Placona wrote:
Hi, I've just got back to working on an integration with the Adwords API, and realized it had to be upgraded (from v201109).

This was previously a prototype application, that is now scheduled to come to life, and what I've noticed is that there's been a big leap from v201109 to v201209 in terms of authentication.

By reading Takeshi's reply here, it became clear that the entire concept of sandbox has now been phased out, and we now work on the basis of having a test account.

Initially on my prototype I was only using ClientLogin as the AuthorizationMethod through a test account. However, with the new authentication I've realized I will actually have to use our actual live MCC account with a test account as described here.

All well and good, I've got the account created, and have requested permission to use it as a test account. However using the live credentials on:

<add key="AuthorizationMethod" value="ClientLogin" />
<add key="Email" value="xxx"/>
<add key="Password" value="xxxxx"/>

Isn't an option... :-(

I then thought about requesting an OAuth key pair in order to use them on my application instead. All the documentation I found about getting one of those seems a bit rough around the edges, so I'm not really sure how to get one of those without actually making my application request it. Ideally, I'd like to go somewhere, generate it, and then use it on my config file as such. 

<add key="AuthorizationMethod" value="OAuth" />
<add key="OAuthConsumerKey" value="INSERT_YOUR_OAUTH_CONSUMER_KEY_HERE" />
<add key="OAuthConsumerSecret" value="INSERT_YOUR_OAUTH_CONSUMER_SECRET_HERE" />

Is that even possible? If so, where can I generate the OAuth keys?

Thanks in advance,

Marcos

Anash P. Oommen (AdWords API Team)

unread,
Feb 4, 2013, 3:20:37 AM2/4/13
to adwor...@googlegroups.com
Hi Marcos,

Yes, ClientLogin is deprecated in favour of OAuth2. See https://developers.google.com/accounts/docs/AuthForInstalledApps for details. However, ClientLogin is part of Google Apps API, which has a 3 year deprecation policy (https://developers.google.com/accounts/terms), so my guess is that it is okay to use ClientLogin for the time being.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Friday, February 1, 2013 9:34:11 PM UTC+5:30, Marcos Placona wrote:
Hi Anash,

thank you for your answer.

You're absolutely right, I could just use the test account (and its credentials), and carry on using ClientLogin. I have done it now, and it works.

However, I remember reading somewhere that ClientLogin would be phased out in favour of OAuth2, and if that's the case, I should probably already start thinking about how to implement it with OAuth2. Can you please confirm if my statement is correct, and ClientLogin is really going to be phased out? 

Thank you so much for your answers,

Marcos

Marcos Placona

unread,
Feb 4, 2013, 4:44:06 AM2/4/13
to adwor...@googlegroups.com
Thank you very much Anash!

I think I will do all my tests (and prototype) using ClientLogin for simplicity sake, but add a step into the build to actually do the oAuth authentication. I know I've got time, but wanna make sure I won't need to do this in a hurry down the line when ClientLogin is to be sunset.

With kindest regards,

Marcos

Alan Coleman

unread,
Aug 19, 2013, 11:47:17 AM8/19/13
to adwor...@googlegroups.com
Anash,

The link in your post throws a 404. Any chance you could dig this out for me, I'm interested because I'm having a little trouble moving over from Client Login to OAuth2. See here: https://developers.google.com/adwords/api/community/?place=msg%2Fadwords-api%2FNi7VJB6r-M4%2FZDMFJOBD9Z4J

Cheers

Whatsome WithAll

unread,
Jun 26, 2014, 6:34:18 AM6/26/14
to adwor...@googlegroups.com
@Marcos
Can you please your code to authorize and post data to Google Adwords API using ClientLogin?
I am a bit new to c# and .Net and dont know from where to start. 
It will be too much helpful to me.
Thanks and Regards
Tom

Anash P. Oommen (AdWords API Team)

unread,
Jul 10, 2014, 11:51:06 PM7/10/14
to adwor...@googlegroups.com
Hi,

Please follow these wiki articles to start using AdWords API with the latest .NET client library:

3. Generate refresh token and configure your application: https://github.com/googleads/googleads-dotnet-lib/wiki/Using-OAuth2TokenGenerator

Another approach would be to watch https://www.youtube.com/watch?v=WifY2fFyaMw. It's for migrating the library from ClientLogin to OAuth2, but the steps to configure the project using OAuth2 is pretty much the same.

Cheers,
Anash P. Oommen,
AdWords API Advisor.
Reply all
Reply to author
Forward
0 new messages