开发者

xauth using python-oauth2

开发者 https://www.devze.com 2023-02-20 21:48 出处:网络
I am trying to implement xauth for instapaper using python-oauth2. I am able开发者_开发知识库 to find samples for oauth but I didnt find any for xauth. Can someone share samples or the api documentati

I am trying to implement xauth for instapaper using python-oauth2. I am able开发者_开发知识库 to find samples for oauth but I didnt find any for xauth. Can someone share samples or the api documentation?


here is the code that worked for me finally


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))
0

精彩评论

暂无评论...
验证码 换一张
取 消