401 Unauthorized using Yahoo OAuth

只愿长相守 提交于 2019-11-29 07:34:52

As I'm sure you know, 401 means not authorised. It probably means that your signature is not valid.

You don't post all of your code but I can't see how it could possibly correctly generate the correct signature, since your signature method seems not to take any of the parameters -- most tellingly the timestamp and nonce -- as input. If you've already calculated the signature correctly, then you need to use the exact same timestamp and nonce in the Authorized header; using a different one will mean that the signature is not valid.

Ok first of all:

http://www.youtube.com/watch?v=lZLP0siJI-8&feature=related

Secondly, the solution;

Don't run it from localhost :P

When I signed up on Yahoo I should've read more carefully, I signed up a second time just to see, and it clearly states from which domain will you be making the calls to our APIs.

I was running into the same thing... you have to carefully read the spec:

http://developer.yahoo.com/oauth/guide/oauth-requesttoken.html

Carefully follow the directions for each field. For example, I don't see that you have specified oauth_callback="oob". I was missing that field as well, as soon as I specified it, I got the token.

I am replying with hope that it will help someone else.

Yahoo! stores the domain in lowercase and I was storing the domain in mixed case in the callback variable.

So I converted the domain to all lowercase and prefixed it with "www." which got me to resolve the issue. Try to hit the Yahoo! servers with the final OAUTH URL from any browser to see the actual error message. Within app it just says "unauthorized".

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!