1

是否有可能仅从 aws lambda 中的脚本检索访问令牌而无需用户交互?=>

url = f'https://{user}:{password}@api.stocktwits.com/api/2/oauth/authorize?client_id={client_id}&response_type=token&redirect_uri={redirect_uri}&scope=publish_messages'

response = requests.get(
    url, allow_redirects=True
)

目前我只检索重定向到 => https://api.stocktwits.com/api/2/oauth/signin

4

1 回答 1

1

这个问题有很多解决方案。我假设您正在重定向到请求登录表单的 oauth 页面?如果是这种情况,您可以这样做的一种方法是使用 selenium 驱动该页面并让它为您填写凭据,然后您将能够检索访问令牌。

于 2018-12-07T01:59:50.003 回答