vishnu-milan / 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

Not returned any information is token revoked or not #193

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Method Google_Client->refreshToken($refreshToken) does not return any 
information about success operation.

What is the expected output? What do you see instead?
Boolean value or invoking exception in 
Google_OAuth->refreshToken($refreshToken) when response code is different to 
200.

What version of the product are you using? On what operating system?
I use the current trunk on Linux Ubuntu/CentOS. This issue is platform 
independent.

Please provide any additional information below.
N/A

Original issue reported on code.google.com by atish...@gmail.com on 18 Sep 2012 at 10:08

GoogleCodeExporter commented 9 years ago
If it fails we will throw a Google_AuthException

Original comment by ianbar...@google.com on 22 Mar 2013 at 3:39

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Sorry, this problem is on revokeToken method.
Especially in method Google_OAuth2->revokeToken()
There are not throw Google_Authexception.

    if (!$token) {
      $token = $this->token['access_token'];
    }
    $request = new Google_HttpRequest(self::OAUTH2_REVOKE_URI, 'POST', array(), "token=$token");
    $response = Google_Client::$io->makeRequest($request);
    // should be added
    $body = $request->getResponseBody();
    //////////////////
    $code = $response->getResponseHttpCode();
    if ($code == 200) {
      $this->token = null;
      return true;
    }
    // should be added
    else {
        throw new Google_AuthException("Error revoking the OAuth2 token, message: '$body'", $code);
    }
    //////////////////

    // should be removed
    return false;
    ////////////////////

Original comment by atish...@gmail.com on 22 Mar 2013 at 4:16