anuj607 / google-api-php-client

Automatically exported from code.google.com/p/google-api-php-client
Apache License 2.0
0 stars 0 forks source link

Support for revoking a refresh_token #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice if the library had a method for programmatically revoking the 
refresh_token.  It's not terribly difficult to do, but it seems like something 
that should be handled by the library...

This is how we are doing it currently:

$ch = curl_init ('https://accounts.google.com/o/oauth2/revoke');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('token' => $token));
curl_exec($ch);

Original issue reported on code.google.com by digitalp...@gmail.com on 14 Dec 2011 at 7:02

GoogleCodeExporter commented 9 years ago
Thank you for reporting this! $client->revokeToken($token) is now available on 
trunk.
http://code.google.com/p/google-api-php-client/source/checkout

client->revokeToken($token) will revoke an OAuth2 access token or refresh 
token. It will revoke the current access if a token isn't provided.

Original comment by chirags@google.com on 6 Jan 2012 at 6:47