gpt4 book ai didi

api - Twitter API - "invalid or expired token"的原因

转载 作者:行者123 更新时间:2023-12-02 03:19:23 27 4
gpt4 key购买 nike

可能导致 token 过期的原因有哪些(除了用户取消对应用程序的授权之外)?

我的问题是,我有一个拥有数千名用户的应用程序,所有 API 通信都工作正常,但对于某些用户,我收到 无效或过期 token 错误,但我最初的想法是,他们是取消了应用身份验证的用户,但我已经联系了其中一些用户,他们还没有撤消访问权限。

您知道还有哪些其他问题可能导致该错误吗?

最佳答案

通过调用 GET account/verify_credentials 随时检查访问 token 的完整性使用该访问 token 时。

它被提及,通过研究我了解到:

Your access token will be invalid if a user explicitly rejects your application from their settings or if a Twitter admin suspends your application. If your application is suspended there will be a note on your application page saying that it has been suspended.

为什么我的 Twitter oauth 访问 token 无效/过期?

查看此帖子:invalid / expired access tokens .

Google 群组中有一篇帖子说:

You don't get a second chance, and this is by design. OAuth requests have a unique signature; once a particular request is submitted, it can't be submitted again. If they enter the pin correctly, all is well, you get an access token. If they enter the pin wrong, you get 401 Unauthorized - which is expected. But if they then try again to enter the pin, even the correct pin shows as unauthorized.

检查这个link以上供引用。

twitter 员工针对同一问题的一些建议:

I guess there are two things I would suggest at this point: 1.) Go to your application settings and use the "Reset keys" tab to reset your consumer key and secret, then update those values in the app and verify that you still see the same behavior. 2.) Try passing oauth_callback in your request_token call. Honestly I don't think this will make a difference, but I want to try and be as rigorous as I can here.

另请检查此 discussion说:

You need to use the oauth_token and oauth_token_secret returned from the oauth/access_token call instead of the one in your app's settings in dev.twitter.com

关于api - Twitter API - "invalid or expired token"的原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17636701/

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