要在 twitter api 中获取访问 token ,您首先应该获取请求 token ,以便可以授予对用户帐户的访问权限。我发现访问 token 不会过期,除非它被用户撤销。请求 token 怎么样?它们会过期吗?它们的有效期是多长?
最佳答案
好的,我已经找到了 OAuth 规范的答案 http://oauth.net/core/1.0/#anchor9
Used by the Consumer to ask the User to authorize access to the Protected Resources. The User-authorized Request Token is exchanged for an Access Token, MUST only be used once, and MUST NOT be used for any other purpose. It is RECOMMENDED that Request Tokens have a limited lifetime.
这里还有一个有用的 oauth 流程图(我花了很长时间才学习流程)
所以答案是 - 非常短。
PS:我问这个问题的原因只是为了简化整个过程,获取一次请求 token 并为不同的用户多次使用它。
关于api - Twitter oauth 请求 token 过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24210891/