2

コンソールで 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 からのエラー


致命的なエラー: 例外「Google_AuthException」がキャッチされず、「OAuth2 トークンの更新中にエラーが発生しました。メッセージ:」{ 「エラー」:「unauthorized_client」 }'' in google-api-php-client/src/auth/Google_OAuth2.php:280 スタックトレース: #0 google-api-php-client/src/auth/Google_OAuth2.php(240): Google_OAuth2->refreshTokenRequest(配列) #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(配列) #5 {メイン}google-api-php-client/src/auth/Google_OAuth2.phpの280行目で スローされます
4

1 に答える 1

1

これの最も可能性の高い原因は、更新に使用されたものとは異なるクライアント ID/シークレットによって更新トークンが生成されたことです。コンソールで新しい API キーに変更した場合は、ユーザーを再認証する必要があります。古いクライアントで作成されたトークンを更新することはできません。

于 2013-08-02T20:02:55.860 に答える