google-api-php-client icon indicating copy to clipboard operation
google-api-php-client copied to clipboard

Google_Auth_OAuth2->authenticate() does not throw exception with full error information.

Open CompulsiveComputing opened this issue 12 years ago • 2 comments

Exceptions thrown in Google_Auth_OAuth2->authenicate() do not include the full error, only gives error code: does not include server provided error-description.

eg:

After calling $gClient->authenticate($_GET['code']); the following is thrown:

current exception information: "Error fetching OAuth2 access token, message: 'invalid_request'"

However the response from Google servers includes:

"error" : "invalid_request", error_description" : "Client must specify either client_id or client_assertion, not both"

CompulsiveComputing avatar Jul 11 '14 03:07 CompulsiveComputing

Good point, we should include that. PRs welcome, or I will take a look at this next time I'm doing some work on the lib, should be fairly straightforward.

ianbarber avatar Jul 15 '14 11:07 ianbarber

Just sent #320 with the change to include error description.

ianbarber avatar Sep 12 '14 16:09 ianbarber