私はクライアントに、彼がgoogleapiプロジェクトを作成した許可されたGmailアカウントでこのURLをヒットするように依頼します。
https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/androidpublisher&response_type=code&access_type=offline&redirect_uri=http://www.XXXXXXXX.com/oauth2callback&client_id=XXXXXX.apps.googleusercontent.com&state=profile&approval_prompt=force
次に、リダイレクトされたURLからコードパラメータを提供するように彼に依頼します
http://www.XXXXXXXX.com/oauth2callback?code=4/jUxc2MdX0xmF-b4_I6v2SLMQMuxO.cvQLVEpcJMUXOl05ti8ZT3ZvsT9ddwI
それから私自身、このフォームに次の情報を投稿します。
<form action="https://accounts.google.com/o/oauth2/token" method="post" >
<input type="hidden" name="grant_type" value="authorization_code" >
<input type="text" name="code" value="**is the one i recieved from previous step**">
<input type="hidden" name="client_id" value="XXXXXXX.apps.googleusercontent.com" >
<input type="hidden" name="client_secret" value="XXXXXXXXXXXX" >
<input type="hidden" name="redirect_uri" value="http://www.XXXXXX.com/oauth2callback" >
<input type="submit" value="Submit">
</form>
その後、次のエラーが発生します
{
"error" : "invalid_grant"
}
コードurlparamを自分で生成し、次の手順を実行するとき。私は次の応答で正常に提示されます
{
"access_token" : "XXXXXXStBkRnGyZ2mUYOLgls7QVBxOg82XhBCFo8UIT5gM",
"token_type" : "Bearer",
"expires_in" : 3600,
"refresh_token" : "XXXXXX3SEBX7F2cfrHcqJEa3KoAHYeXES6nmho"
}
しかし、クライアントがurl param "code"を生成すると、無効な付与エラーが表示されます。
私のクライアントは英国にいて、私は別の国にいます。クライアントが別の国でコードパラメータを生成していて、私がそのコードを別の国で使用しているため、エラーかどうかを誰かに確認できますか?
前もって感謝します。