Hi Alan,

You're correct, we've renamed and moved some of the OAuth2 related methods.

The main change to the OAuth2 interface is the separation of the 
OAuth2Handler<https://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ads/Common/Util/OAuth2Handler.php>from
 the 
AdWordsUser<https://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ads/AdWords/Lib/AdWordsUser.php>.
 
The AdWordsUser now has two OAuth2 related purposes, to store the 
OAuth2Info<https://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ads/Common/Lib/AdsUser.php#382>(credentials)
 and the 
OAuth2Handler<https://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ads/Common/Lib/AdsUser.php#398>.
 
It no longer provides convenience methods for interacting with the 
OAuth2Handler.

So for the above example, you'd need to change some of the lines.

// Create a new user
$user = new AdWordsUser();
 
// Load the oAuth settings
$oauth2Info = loadAuth($filename);
// Get or refresh the access token.
$oauth2Info = $user->GetOAuth2Handler()->GetOrRefreshAccessToken($oauth2Info);
$user->SetOAuth2Info($oauth2Info);


An example of this in use in the client library is 
AdWordsSoapClient<https://code.google.com/p/google-api-adwords-php/source/browse/src/Google/Api/Ads/AdWords/Lib/AdWordsSoapClient.php#55>
.

Regards,

- Paul, AdWords API Team.

On Tuesday, 5 November 2013 22:43:09 UTC, Alan Coleman wrote:
>
>
> Hello everyone,
>
> I'm having a few issues migrating from v201302. In particular checking 
> that the Access Token is still valid, whether it can be refreshed and 
> finally refreshing it.
>
> I've been looking through v201306 and have noticed that various user 
> functions have had their names changed, *IsOAuth2AccessTokenValid*to *
> IsAccessTokenValid* for example. Is this documented anywhere?
>
> The code below checks the status of the Access Token and refreshes 
> if necessary, however it is returning an authentication error under v201306.
>
> *Library: adwords_api_php_4.5.1**
> Version: v201306*
>
> .........
>
> // Create a new user
> *$user = new AdWordsUser();*
>
> // Load the oAuth settings
> * $user->SetOAuth2Info(loadAuth($filename));*
> // Check that the access token is still valid
> *if (!$user->IsOAuth2AccessTokenValid()) {*
> // Check that the token can be refreshed
> *if ($user->CanRefreshAccessToken()) {*
> // Refresh the token
> *$user->RefreshOAuth2AccessToken();*
> ..........
>
> Any ideas would be gratefully accepted.
>
> Thank you.
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://googleadsdeveloper.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