优步OAuth重定向URI错误

时间:2015-08-25 03:30:14

标签: javascript node.js facebook oauth uber-api

我尝试使用javascript和node.js在Uber的API上开发Web应用程序,在尝试使用OAuth 2.0对用户进行身份验证时,我收到了错误

Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings.  It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

在此代码片段之后会出现这种情况,我会按照Uber的说明显示登录页面:

app.get('/home', function(req, res){
var loginURL = "https://login.uber.com/oauth/authorize?response_type=code&client_id=" + client_id + "&redirect_uri=https://localhost:3000/login";

  request(loginURL, function (error, response, body) {
    if (!error && response.statusCode == 200) {
      res.send(body) // Show the HTML for the Google homepage.
    }
  });
});

在我的超级帐户中,我已将所有以下内容添加到授权下的重定向网址部分:

http://localhost
http://localhost:3000/login
https://localhost:3000
https://localhost:3000/login

有一件有趣的事情是,当我加载页面时,我在浏览器的控制台中看到了这个错误,但是当我点击"使用facebook"登录时,我也会收到相同消息的弹出错误并且弹出错误的网址在facebook域(https://www.facebook.com/v2.2/dialog/oauth?app_id=277064115737714&client_id=277064115737714&display=popup&domain=localhost&e2e=%7B%7D&locale=en_US&origin=1&redirect_uri=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2FPqAPb.....下。)。这可能是uber发送给Facebook的重定向uri吗?

我做错了什么?

0 个答案:

没有答案