Python:OAuth请求和访问令牌?

时间:2018-09-19 02:11:32

标签: python oauth

如何使用requests_oauthlib进行握手?

以下是获得响应400的确切代码:

from requests_oauthlib import OAuth1Session
import requests
from requests_oauthlib import OAuth1
from variables import *

client_key = consumer_key
client_secret = consumer_secret

request_token_url = 'https://etws.etrade.com/oauth/request_token'

oauth = OAuth1Session(client_key, client_secret=client_secret)
fetch_response = oauth.fetch_request_token(request_token_url)

resource_owner_key = fetch_response.get('oauth_token')
resource_owner_secret = fetch_response.get('oauth_token_secret')

这是我正在关注的教程:

https://requests-oauthlib.readthedocs.io/en/latest/oauth1_workflow.html#workflow-example-showing-use-of-both-oauth1-and-oauth1session

请帮助。我不知道为什么这么难。并且有关于该模块和子模块的手册吗?

0 个答案:

没有答案