[英]Stocktwits API - get access token from script without user interaction
Is there a possibility to retrieve access token just from script in aws lambda without user interaction in the next way?是否有可能仅从 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
)
For this moment I only retrieve redirect to => https://api.stocktwits.com/api/2/oauth/signin ?目前我只检索重定向到 => https://api.stocktwits.com/api/2/oauth/signin ?
There is a plethora of solutions for this question.这个问题有很多解决方案。 I'm assuming you are redirecting to an oauth page where it's requesting a sign in form?我假设您正在重定向到一个请求登录表单的 oauth 页面? If that is the case one way you could do it is drive that page with selenium and have it fill in the credentials for you then you will be able to retrieve the access token.如果是这种情况,您可以采用的一种方法是使用 selenium 驱动该页面并让它为您填写凭据,然后您将能够检索访问令牌。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.