oAuth 2.0 Google API asp.net Requesting Token

i have a problem getting token from google api, first i make this request to get code from 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

this seems to be working fine (im getting a code from google) after that i make another request to get token using that code, for this i make:

accounts.google.com/o/oauth2/token?client_secret={my client secret}&grant_type=authorization_code&redirect_uri={http://pedidostogo.com/Login.aspx}&client_id={my client id}&code={code i get from google}

but when i do that POST request im getting:

Status: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"
}

can anyone tell me what im doing wrong? thanks.

链接地址: http://www.djcxy.com/p/80052.html

上一篇: oAuth 2.0适用于谷歌应用程序审计api

下一篇: oAuth 2.0 Google API asp.net请求令牌