gpt4 book ai didi

python - xauth 使用 python-oauth2

转载 作者:太空狗 更新时间:2023-10-29 20:52:51 30 4
gpt4 key购买 nike

我正在尝试使用 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/

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