寻找一种获取单用户access_token的方法。看起来像是API Documentation说有可能通过一个curl请求来验证用户并获取access_token:
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看起来重定向到登录页面。这个功能是不是被移除了,或者我在什么地方犯了错?
发布于 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
https://stackoverflow.com/questions/41978843
复制相似问题