Recently, I have just created a yahoo application by following the online [yahoo oauth 2.0 guide for developer,][2]
I can get the OAuth 2.0 credential but meet "unable_to_determine_oauth_type" oauth problem while calling yahoo IM related [API][3]. Why?
Here is my steps:
curl -v https://api.login.yahoo.com/oauth2/request_auth -d 'client_id=[CLIENT-ID]&redirect_uri=oob&response_type=code&language=en-us'it then redirects me to
https//login.yahoo.com/oa?.src=oauth2&.partner=&.pd=c%3DmZmAFpe.2e7WuWzcHD2ZPYQ-%26ockey%3Ddj0yJmk9Q1N4cldYYXdKYXhNJmQ9WVdrOWIyOXdXbG95TnpnbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD0yOQ--&.intl=us&.lang=en-us&.done=https%3A%2F%2Fapi.login.yahoo.com%2Foauth2%2Frequest_auth%3F%26client_id%3Dd[CLIENT-ID]%26redirect_uri%3Doob%26response_type%3Dcode%26language%3Den-us%26crumb%3DBy following it in browser, I get the code:
dpr5bnmI concat the client id and secret into one string separated by ':' and go to base64 encode it (https://www.base64encode.org)
get the basic credential:
ZGoweUptazlRMU40Y2xkWVlYZEtZWG...ldOSGJ6bE5RUzB0Sm5NOVkyOXVjM1Z0WlhKelpXTnlaWFFtZUQweU9RLS06YjY3MmZlZDcwOGFhYmRjNDFiNGRmYmNlZmY3MzU1YmU2MmRhMWRkZQ==then, call get_token API
curl https//api.login.yahoo.com/oauth2/get_token -H "Content-Type: application/x-www-form-urlencoded" -H "Authorization: Basic ZGoweUptazlRMU40Y2xkWVlYZEtZ...YldOSGJ6bE5RUzB0Sm5NOVkyOXVjM1Z0WlhKelpXTnlaWFFtZUQweU9RLS06YjY3MmZlZDcwOGFhYmRjNDFiNGRmYmNlZmY3MzU1YmU2MmRhMWRkZQ==" -d "grant_type=authorization_code&redirect_uri=oob&code=dpr5bnm"get json access token response: {"access_token":"fiTeDQrBnQVB...u5DGLu.M-","token_type":"bearer","expires_in":3600,"refresh_token":"AFaPK...xDSwSZ.Ke4jffDDboSpO6fg2t","xoauth_yahoo_guid":"ZT3Y7L7...5QJ7SAU5Q"}
But when i use the token willing to use session management API to login: (OAuth 2.0 Bearer Authorization)
`curl -v http//developer.messenger.yahooapis.com/v1/session -H "Content-type: application/json;charset=utf-8" -H "Authorization: Bearer B_YnLlibghNNJIW0HlaITp0mkcTFEovpF...oJZuzUvjVDM0ko.QjT4io-"
it show the following error:
<yahoo:description>Please provide valid credentials. OAuth oauth_problem="unable_to_determine_oauth_type"</yahoo:description>
So do anyone know why and how to make a yahoo IM message?
来源:https://stackoverflow.com/questions/29598642/how-to-use-yahoo-im-messaging-api-unable-to-determine-oauth-type