Google API-OAuth2-无效的\u请求

Google API-OAuth2-无效的\u请求,oauth,google-api,oauth-2.0,Oauth,Google Api,Oauth 2.0,我被这个错误缠住了。 我刚刚成功地收到了一个授权码,我正在尝试将其交换为访问令牌,但收到错误消息“invalid_request” 我正在使用ApacheHttpComponents库(当前版本)进行请求,当我发出post请求时,会看到UrlEncodedFormEntity 这是我的申请信息: Request body: scope=&client_secret=[my_secret]&grant_type=authorization_code&redirect_uri

我被这个错误缠住了。 我刚刚成功地收到了一个授权码,我正在尝试将其交换为访问令牌,但收到错误消息“invalid_request”

我正在使用ApacheHttpComponents库(当前版本)进行请求,当我发出post请求时,会看到UrlEncodedFormEntity

这是我的申请信息:

Request body: scope=&client_secret=[my_secret]&grant_type=authorization_code&redirect_uri=http%3A%2F%2Fmydomain.org%3A8080%2F[some parameters etc...]%3FplatformID%3D3&client_id=23[...]-rg[...].apps.googleusercontent.com&code=[my_encoded_authorizationCode]

Request-URL: https://accounts.google.com/o/oauth2/token

Request-Method: POST

Request headers -- 

    User-Agent = MAC: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/536.25 (KHTML, like Gecko) Version/6.0 Safari/536.25     // this is a fake user agent I have set by the header manipulation

    Content-Type = application/x-www-form-urlencoded

Response headers -- 

    Cache-Control = no-cache, no-store, max-age=0, must-revalidate

    Pragma = no-cache

    Expires = Fri, 01 Jan 1990 00:00:00 GMT

    Date = Sun, 02 Dec 2012 11:44:34 GMT

    Content-Type = application/json

    X-Content-Type-Options = nosniff

    X-Frame-Options = SAMEORIGIN

    X-XSS-Protection = 1; mode=block

    Server = GSE

    Transfer-Encoding = chunked

Response:

{

  "error" : "invalid_request"

}
有什么帮助吗? 我被困了好几天,正在研究和实现其他OAuth2协议,但谷歌的协议不起作用

致以最良好的问候和感谢, 马丁·鲍里斯