我尝试按照here所述的步骤,在用户oauth 1.0令牌上执行迁移到oauth 2.0令牌。
以下是我正在制作的电话示例,重定向到我的localhost。
POST / HTTP/1.1
Host: localhost:8080
Content-Length: 162
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.6.2 CPython/2.7.10 Darwin/14.1.0
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Authorization: OAuth oauth_nonce="52494019971914196991439415494", oauth_timestamp="1439415494", oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_consumer_key="xxxxx.com", oauth_token="x%2Fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxx", oauth_signature="Da%2Bb0gFGyYT6AR2Xb5TAX5ynKQQ%3D"
client_secret=-FeCSEHzGADOt-3On5rE7Ghi&grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Amigration%3Aoauth1&client_id=xxxxxxxxxxxxx.apps.googleusercontent.com
我尝试过的每个令牌都会返回400错误:
{ "error" : "invalid_token", "error_description" : "Either the token is invalid or we could not decode it." }
我使用request-oauthlib和postman进行了此调用,结果相同。
我可能做错了什么吗?