1

Google API からトークンを取得する際に問題が発生しました。まず、Google からコードを取得するためにこのリクエストを行います

accounts.google.com/o/oauth2/auth?scope=www.googleapis.com/auth/userinfo.profile        www.googleapis.com/auth/userinfo.email&state=profile&redirect_uri={http://pedidostogo.com/Login.aspx}&response_type=code&client_id=519970867780.apps.googleusercontent.com&access_type=offline

これはうまく機能しているようです(Googleからコードを取得しています)その後、そのコードを使用してトークンを取得する別のリクエストを作成します。

accounts.google.com/o/oauth2/token?client_secret={クライアント シークレット}&grant_type=authorization_code&redirect_uri={ http://pedidostogo.com/Login.aspx }&client_id={クライアント ID}&code={取得元のコードグーグル}

しかし、私がそのPOSTリクエストを実行すると、次のようになります:

ステータス:400 Bad Request

Headers: Pragma: no-cache
Date: Thu, 28 Feb 2013 20:00:00 GMT
Content-Encoding: gzip
X-Content-Type-Options: nosniff
Server: GSE
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked
Content-Type: application/json
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
X-XSS-Protection: 1; mode=block
Expires: Fri, 01 Jan 1990 00:00:00 GMT

Data: {
  "error" : "invalid_request"
}

誰かが私が間違っていることを教えてもらえますか? ありがとう。

4

0 に答える 0