「OAuth 2.0 for Web Serverアプリケーションの使用」ヘルプページを段階的に追っていくうちに404エラーが発生します。 Using OAuth 2.0 for Web Server ApplicationsGoogle APIレスト:更新とアクセストークンのExchange認証コード - エラー404
私はhttp/restリクエストを使用します。
手順5:「更新トークンとアクセストークンの交換認証コード」までは問題ありません。
私のリクエスト(POSTまたはGET)は、404エラー:「見つかりません」を返します。ここ は、ガイドと同様に、私の要求である:ここでは
https://www.googleapis.com/oauth2/v4/token?
code=4/_XXXXXXXXXXXXXXXXXXX__XXXXXXXXXXXXXX-XXXXXX?&client_id=-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.apps.googleusercontent.com&client_secret=XXXXXXXXXXXXXXXXXXX_XXXX&grant_type=authorization_code&redirect_uri=http%3a%2f%2fwww.mydomain.com%3a50000%2fMyPage
はガイドの関連部分です:
"To exchange an authorization code for an access token, call the https://www.googleapis.com/oauth2/v4/token endpoint and set the following parameters:
Fields
code The authorization code returned from the initial request.
client_id The client ID obtained from the API Console.
client_secret The client secret obtained from the API Console.
redirect_uri One of the redirect URIs listed for your project in the API Console.
grant_type As defined in the OAuth 2.0 specification, this field must contain a value of authorization_code."
私は、サービスのURLに問題があると思います。私が間違っている?
いずれも有効なURLを提供できますか?
認可コードには疑問符が含まれていますが、あなたは正しいです:はい、私のコードでURLエンコーディングに問題がありました(私はURLエンコードされた変数を使用しませんでした!)私のコードでは明らかでしたが、誤った道に焦点を当てる。 – Rikou