【问题标题】:Need an OAuth token secret to get an OAuth token secret? What the heck?需要 OAuth 令牌机密来获取 OAuth 令牌机密吗?有没有搞错?
【发布时间】:2013-01-10 01:23:04
【问题描述】:

我一直在尝试实现“使用 Twitter 登录”,但我一直在尝试找出如何为用户获取 OAuth 令牌密码。

Twitter API 文档 (here) 说:

要启动登录流程,您的应用程序必须通过向 POST oauth/request_token 发送 签名消息 来获取请求令牌

...

响应正文将包含 oauth_token、oauth_token_secret 和 oauth_callback_confirmed 参数

创建签名的文档 (here) 说:

标识您的应用程序所代表的帐户的值称为oauth token secret。该值可以通过多种方式获得,所有这些方式都在获取访问令牌中进行了描述。

“获取访问令牌”页面链接回here,完成了循环。

如果我需要令牌密码来签署请求以获取令牌密码,我该如何获取令牌密码?这到底是什么?

【问题讨论】:

    标签: oauth twitter twitter-oauth


    【解决方案1】:

    来自关于创建签名的文档:

    Note that there are some flows, such as when obtaining a request token, 
    where the token secret is not yet known. In this case, the signing key 
    should consist of the percent encoded consumer secret followed by an 
    ampersand character '&'.
    

    您在注册 API 密钥时收到了消费者机密。这就是您要用来签名以获取请求令牌的内容。

    如果不是Twitter API library,我强烈建议您研究使用至少实现 oauth 基础知识的库,例如签名(如果不是 Twitter API library),前提是您选择的语言可用。

    【讨论】:

    • 谢谢,不知道我是怎么错过的。我认为没有任何可用于 Python 3.3 的库支持“使用 Twitter 登录”。
    猜你喜欢
    • 2014-06-14
    • 2013-03-16
    • 1970-01-01
    • 2011-05-03
    • 2012-04-28
    • 2014-08-28
    • 2017-01-16
    • 2011-11-09
    相关资源
    最近更新 更多