Mirror API unauthorized_client

时间:2013-06-21 01:58:30

标签: google-mirror-api google-glass

我尝试在控制台中创建一组新的API密钥,但只是为了接收这些错误:

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

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

更新:来自php sdk示例的index.php的错误


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

1 个答案:

答案 0 :(得分:1)

最可能的原因是刷新令牌是由与用于刷新的客户端ID /机密不同的客户端ID /机密生成的。如果在控制台中更改为新的API密钥,则需要重新授权用户。您无法刷新使用旧客户端创建的令牌。