Hi Nick,

The UseOAuth2 example has been moved to 
GetRefreshToken.php<https://code.google.com/p/google-api-adwords-php/source/browse/examples/AdWords/Auth/GetRefreshToken.php>,
 
which demonstrates retrieving and configuring a refresh token (used by 
OAuth2). For further information on this, please see the OAuth2 wiki 
page<https://code.google.com/p/google-api-adwords-php/wiki/OAuth2>
.

Currently the PHP has no official support for serviced accounts. The only 
work around is to use the 
google-api-php-client<http://code.google.com/p/google-api-php-client/>to handle 
the authentication and pass the result to the 
google-api-adwords-php 
<http://code.google.com/p/google-api-adwords-php>library. To request official 
support for serviced accounts in the PHP 
client library, please log a feature 
request<https://code.google.com/p/google-api-adwords-php/issues/list>
.

Regards,

- Paul, AdWords API Team.

On Tuesday, 8 October 2013 19:21:32 UTC+1, Nick Tulip wrote:
>
> It looks like the example v201209/Misc/UseOAuth2.php has been removed the 
> lib. Do we know why or if it is even possible anymore to use the PHP Lib 
> with OAuth2 for service accounts?
>
> On Tuesday, November 13, 2012 9:50:39 PM UTC-5, Anash P. Oommen wrote:
>>
>> 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 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/groups/opt_out.

Reply via email to