gpt4 book ai didi

推特 API : timestamp out of Bounds when calling oauth request_token

转载 作者:行者123 更新时间:2023-12-02 14:52:12 29 4
gpt4 key购买 nike

我正在尝试将 oauth 流程集成到我的应用程序中。

调用 oauth/request_token 端点时收到 401 错误:

"message": "401 - {\"errors\":[{\"code\":135,\"message\":\"Timestamp out of bounds.\"}]}"

这是我的授权 header :

"Authorization": "OAuth oauth_callback=http%3A%2F%2F127.0.0.1%3A3000%2Ftwitter%2Foauth_callback,oauth_consumer_key=MYKEY,oauth_nonce=150255341200200,oauth_signature_method=HMAC-SHA1,oauth_timestamp=1502553412002,oauth_version=1.0,oauth_signature=d09f2f2a39e51909442ae6ca717e4aeba7066fda"

我可以在响应 header 中看到 Twitter 的服务器时间为:“date”: “Sat, 12 Aug 2017 15:56:52 GMT”

如果我获取时间戳并将其转换为 GMT 日期,我会得到:

Saturday, August 12, 2017 3:56:52.002 PM

我不确定为什么它被认为是越界。

最佳答案

oauth_timestamp 应该是自 1970 年 1 月 1 日 00:00:00 UTC 以来的秒数。

您的时间戳偏差了大约 1000 倍!本来应该是:

oauth_timestamp=1502553412

关于推特 API : timestamp out of Bounds when calling oauth request_token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45709315/

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