首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >向stocktwits验证用户身份

向stocktwits验证用户身份
EN

Stack Overflow用户
提问于 2017-02-01 19:38:02
回答 1查看 531关注 0票数 0

寻找一种获取单用户access_token的方法。看起来像是API Documentation说有可能通过一个curl请求来验证用户并获取access_token:

代码语言:javascript
复制
cURL [ about cURL ]
// Token example
curl -X GET -u <username> -p https://api.stocktwits.com/api/2/oauth/authorize -d 'client_id=<client id>&response_type=token&redirect_uri=http://www.example.com&scope=read,watch_lists,publish_messages,publish_watch_lists,follow_users,follow_stocks'

// Code example
curl -X GET https://api.stocktwits.com/api/2/oauth/authorize -d 'client_id=<client id>&response_type=code&redirect_uri=http://www.example.com&scope=read,watch_lists,publish_messages,publish_watch_lists,follow_users,follow_stocks'

但尝试了几次使用令牌示例提供用户名和密码,但stocktwits看起来重定向到登录页面。这个功能是不是被移除了,或者我在什么地方犯了错?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-02 05:26:16

看起来是对文件的曲解。您无法自行通过请求获取访问令牌。文档状态

Your application requests authorization by redirecting your user to https://api.stocktwits.com/api/2/oauth/authorize with your client_id, response_type set to 'code' and the URL the user should be redirected back to after the authorization process (redirect_uri). Scopes can also be passed (scope) in a comma-delimited list to request further permissions. View the authorize call. Enter the following URL into your browser or direct your users to it for authentication:

您的用户在将他们定向到url后,在提供的表单上输入他们的凭据。请参阅https://stocktwits.com/developers/docs/authentication

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41978843

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档