gpt4 book ai didi

google-oauth - 谷歌 oauth1 到 oauth2 迁移 invalid_token 错误

转载 作者:行者123 更新时间:2023-12-01 15:45:29 27 4
gpt4 key购买 nike

我一直在尝试使用 oauth1 访问 token 获取新的 oauth2 刷新 token ,但它不断返回“invalid_token”错误。我已经检查过并且访问 token 工作正常。我还在 oauth2 playground 中测试了相同的 creds/params,结果是一样的。感谢任何帮助...

这是 curl 的详细输出:

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

最佳答案

您能检查一下您是否将 client_secret 放入 POST 正文中的 {} 中吗?

grant_type=urn:ietf:params:oauth:grant-type:migration:oauth1&client_id=xxxxxxx.apps.googleusercontent.com&client_secret={xxxxxxx}

当您生成 oauth_signature 时,您还需要将 {} 放在 client_secret 值周围

关于google-oauth - 谷歌 oauth1 到 oauth2 迁移 invalid_token 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20990801/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com