Hi Paul,

The AdWords API PHP library already has a code example that shows how to 
use OAuth2 with AdWords API. You can find it 
here: 
http://code.google.com/p/google-api-adwords-php/source/browse/trunk/examples/v201209/Misc/UseOAuth2.php.
 
Also, service accounts allow you to call AdWords API without any user 
interaction, but that is not the only way to achieve server-to-server call. 
If you care only about offline call without user interaction and not about 
impersonating users, then you can use regular OAuth2 call with offline = 
true as explained here: 
https://developers.google.com/accounts/docs/OAuth2WebServer#offline. To 
summarize,

1. You need to get an OAuth2 clientId and secret 
from https://code.google.com/apis/console. When creating the token, select 
"Installed Application" and select "Other" in the "Installed Application 
type".
2. Substitute these values in UseOAuth2.php example and run it. This code 
example will generate an access token and refresh token. The access token 
will expire after an hour, refresh token doesn't.
3. When your access token expires, refresh it using 
$user->RefreshOAuth2AccessToken call.

You could generate a refresh token for your parent MCC once and continue 
using it without requiring user interaction.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

On Tuesday, 13 November 2012 12:59:43 UTC-8, Pianoman wrote:
>
> Dear Google Adwords API Team,
>
> As you are recommending we start authenticating using OAuth 2.0, could you 
> (Eric Koleda for example) please either organise a hangout and/or create a 
> screencast, explaining how to go about OAuth 2.0 authentication using the 
> PHP Client Library?
>
> The only PHP Client Library screencast help I can see online is 
> here<http://youtube.googleapis.com/v/Idvia4600_E>, 
> but that's pretty dated now.
>
> I am unfamiliar with OAuth 2.0.
> For now I am sticking to the deprecated authentication system, but would 
> like to migrate to OAuth 2.0.
>
> Regards,
> --
> Paul
>

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to