2017-02-01 2 views
0

поиск метода получения доступа для одного пользователя. Похоже API Documentation говорит, что его можно идентифицировать пользователя и получить 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 выглядит быть перенаправление на страницу входа в систему. Была ли эта функция удалена или им что-то делать ошибка?

ответ

0

Похоже, что это неправильное толкование документов. Вы не можете получить токен доступа через запросы самостоятельно. Документы заявляют

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:

Ваших пользователей вводят свои учетные данные на поставленной форме после того, как направить их к ссылке. См. https://stocktwits.com/developers/docs/authentication

Смежные вопросы