2

I tried creating a new set of API keys in console, only to receive these errors:

An error ocurred: Error refreshing the OAuth2 token, message: 
{ "error" : "unauthorized_client" }

'An error ocurred: Error refreshing the OAuth2 token, message: 
'{ "error" : "unauthorized_client" }'

Update: Errors from index.php from the php sdk example


Fatal error: Uncaught exception 'Google_AuthException' with message 'Error refreshing the OAuth2 token, message: '{ "error" : "unauthorized_client" }'' in google-api-php-client/src/auth/Google_OAuth2.php:280 Stack trace: #0 google-api-php-client/src/auth/Google_OAuth2.php(240): Google_OAuth2->refreshTokenRequest(Array) #1 google-api-php-client/src/auth/Google_OAuth2.php(217): Google_OAuth2->refreshToken('1/oS0qw-8UsYeFo...') #2 google-api-php-client/src/service/Google_ServiceResource.php(167): Google_OAuth2->sign(Object(Google_HttpRequest)) #3 google-api-php-client/src/contrib/Google_MirrorService.php(434): Google_ServiceResource->__call('list', Array) #4 index-demo.php(140): google_TimelineServiceResource->listTimeline(Array) #5 {main} thrown in google-api-php-client/src/auth/Google_OAuth2.php on line 280
ina
  • 19,167
  • 39
  • 122
  • 201
  • 2
    Can you clarify the question a bit? When did you get these error messages, and what was going on at the time? – Prisoner Jun 21 '13 at 03:32
  • There are many potential causes of this. Can you please share the code that you're using to make the request? One thing you may want to sanity check is that the Mirror API is enabled for your project via the toggle found on the Services panel of https://developers.google.com/console – mimming Jun 21 '13 at 17:52
  • Mirror API is definitely enabled for the project... Updated with some errors excepted from index.php in the PHP quick start in @Jenny Murphy github – ina Jun 21 '13 at 19:01
  • Thanks for the update. It happening during refresh. The most likely cause of this is that the refresh token was generated by a different client id/secret than was used to for the refresh. If you change to a new API key in the console, you need to re-auth users. You cannot refresh tokens created with your old client. – mimming Jun 24 '13 at 17:28

1 Answers1

1

The most likely cause of this is that the refresh token was generated by a different client id/secret than was used to for the refresh. If you change to a new API key in the console, you need to re-auth users. You cannot refresh tokens created with your old client.

mimming
  • 13,974
  • 3
  • 45
  • 74