2014-01-08 58 views
3

我一直在尝试使用oauth1访问令牌获取新的oauth2刷新令牌,但它不断返回“invalid_token”错误。我已检查并且访问令牌工作正常。我也在oauth2 playground中测试过相同的creds/params,结果是一样的。任何帮助表示赞赏...谷歌oauth1到oauth2迁移invalid_token错误

这里是卷曲的详细输出:

> POST /o/oauth2/token HTTP/1.1 
Host: accounts.google.com 
Content-Type: application/x-www-form-urlencoded 
Authorization: OAuth oauth_nonce="cb7407355fe20f509cb6bf901eae2d24", oauth_timestamp="1389169471", oauth_consumer_key="***", oauth_token="1%2FFVy....", oauth_signature_method="HMAC-SHA1", oauth_signature="0YL1hH5R571nOH1byeHxQlg%2Fa6g%3D" 
Content-Length: 444 

* upload completely sent off: 444 out of 444 bytes 
< HTTP/1.1 400 Bad Request 
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate 
< Pragma: no-cache 
< Expires: Fri, 01 Jan 1990 00:00:00 GMT 
< Date: Wed, 08 Jan 2014 08:24:31 GMT 
< Content-Type: application/json 
< X-Content-Type-Options: nosniff 
< X-Frame-Options: SAMEORIGIN 
< X-XSS-Protection: 1; mode=block 
* Server GSE is not blacklisted 
< Server: GSE 
< Alternate-Protocol: 443:quic 
< Transfer-Encoding: chunked 
< 
* Connection #0 to host accounts.google.com left intact 
string(415) "HTTP/1.1 400 Bad Request 
Cache-Control: no-cache, no-store, max-age=0, must-revalidate 
Pragma: no-cache 
Expires: Fri, 01 Jan 1990 00:00:00 GMT 
Date: Wed, 08 Jan 2014 08:24:31 GMT 
Content-Type: application/json 
X-Content-Type-Options: nosniff 
X-Frame-Options: SAMEORIGIN 
X-XSS-Protection: 1; mode=block 
Server: GSE 
Alternate-Protocol: 443:quic 
Transfer-Encoding: chunked 

{ 
    "error" : "invalid_token" 
}" 
+0

感谢您报告问题。我正在研究这个,会尽快更新这个线程。 –

回答

0

我们已经做出了OAuth1->的OAuth2令牌迁移的确认件数的变化。你会介意再次检查你的迁移流程并更新这个线程的结果吗?

1

你可以检查你是否将client_secret放置在POST Body中的{}中?

grant_type =瓮:IETF:PARAMS:OAuth的:授型:迁移:您好!OAuth1 &的client_id = xxxxxxx.apps.googleusercontent.com & client_secret = {XXXXXXX}

你也需要把{ }在生成oauth_signature时围绕client_secret值