python - xauth 使用 python-oauth2

标签 python sample xauth

我正在尝试使用 python-oauth2 为 instapaper 实现 xauth。我能够找到 oauth 的样本,但我没有找到 xauth 的样本。有人可以分享示例或 api 文档吗?

最佳答案

这是最终为我工作的代码


consumer_key=<key>
consumer_secret=<secret>
access_token_url = 'https://www.instapaper.com/api/1/oauth/access_token'

consumer = oauth.Consumer(consumer_key, consumer_secret)
client = oauth.Client(consumer)
client.add_credentials(instaaccount,instapassword)

params = {}
params["x_auth_username"] = instaaccount
params["x_auth_password"] = instapassword
params["x_auth_mode"] = 'client_auth'

client.set_signature_method = oauth.SignatureMethod_HMAC_SHA1()
resp, token = client.request(access_token_url, method="POST",body=urllib.urlencode(params))

关于python - xauth 使用 python-oauth2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5503260/

相关文章:

iphone - 为 iPhone 应用程序注册 Tumblr 应用程序

python - 我可以使用 python 中的 coerce() 函数添加两个元组以形成一个新元组吗?

python - 在命令行上编写函数和运行程序

r - 如何使用 R 创建独特的样本(每个元素仅出现在一个样本中)?

branch - 如何在采样模式下使用perf_event_open读取BRANCH STACK的值?

c++ - Qt:在 ubuntu 中使用 crontab 定期启动一个消息框

python - 退出时出现 SystemExit 和 NameError 问题

python - (Python)Selenium Webdriver 在获取新 url 后返回旧元素

c - 具有主要功能的多个源文件

web-services - 具有特殊字符和 Xauthfile 的 wsimport