使用Javascript Rdio API时出现400错误

时间:2015-08-11 23:07:23

标签: javascript oauth-2.0 rdio

有关我为何无法加载资源的任何想法:服务器响应状态为400(错误请求)"在我的客户端的Javascript? (客户端ID被遮挡,我通过注册Rdio网站获得了一个Oauth2.0应用程序)

的index.html:

 <script src="https://www.rdio.com/api/api.js?client_id=12345678"></script>

响应:

https://www.rdio.com/oauth2/authorize/auto?response_type=token&client_id=12345678&showSignup=true&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fhelper.html%3Fclient_id%3D12345678

Failed to load resource: the server responded with a status of 400 (Bad Request)

约翰

1 个答案:

答案 0 :(得分:2)

https://www.rdio.com/oauth2/authorize/auto请求中的响应文本应显示错误。例如,从shell发出请求:

$ curl "https://www.rdio.com/oauth2/authorize/auto?response_type=token&client_id=12345678&showSignup=true&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fhelper.html%3Fclient_id%3D1234567"

对于有效的客户端ID,可能的响应可能是:

  

redirect_uri无效

如果这是您收到的错误,可能需要解决,您需要将redirect_uri的域添加到your Rdio application's settings中的重定向URI。