0

我正在尝试使用 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.
    }
  });
});

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

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

一件有趣的事情是,当页面加载时,我在浏览器的控制台中看到了这个错误,但是当我点击“使用 facebook 登录”并且弹出错误的 url 在下面时,我也会收到一个带有相同消息的弹出错误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 的问题吗?

我究竟做错了什么?

4

0 回答 0