Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs passport.js auth0策略交叉登录请求错误_Angularjs_Node.js_Passport.js_Passport Facebook_Auth0 - Fatal编程技术网

Angularjs passport.js auth0策略交叉登录请求错误

Angularjs passport.js auth0策略交叉登录请求错误,angularjs,node.js,passport.js,passport-facebook,auth0,Angularjs,Node.js,Passport.js,Passport Facebook,Auth0,我正在尝试在我的web应用程序中使用auth0进行社会验证 我像这样配置了应用程序 auth0 : { domain : "mydomain", clientID : "myid", clientSecret: "mysecret", callbackURL: "/callback" }, app.get('/callback', passport.authenticate('auth0', { failureRedirect: '#!/authServiceImpl/logi

我正在尝试在我的web应用程序中使用auth0进行社会验证

我像这样配置了应用程序

auth0 : {
  domain : "mydomain",
  clientID : "myid",
  clientSecret: "mysecret",
  callbackURL: "/callback"
},
app.get('/callback', passport.authenticate('auth0', { failureRedirect: '#!/authServiceImpl/login' }), 
    function(req, res) {
      console.log('auth0 callback');
      console.log(req.user);
    }
  );
我请求使用http从angular controller登录到节点后端,如

  app.get('/auth/:connection', function(req, res, next) {

    passport.authenticate('auth0', {connection: req.params.connection}, function(err, user, info) {

    }) (req, res, next);
  });
我会像auth/facebook一样从客户端控制器调用facebook登录

回调路由的配置如下

auth0 : {
  domain : "mydomain",
  clientID : "myid",
  clientSecret: "mysecret",
  callbackURL: "/callback"
},
app.get('/callback', passport.authenticate('auth0', { failureRedirect: '#!/authServiceImpl/login' }), 
    function(req, res) {
      console.log('auth0 callback');
      console.log(req.user);
    }
  );
每次我收到跨源请求错误时。 我做错了什么

我请求使用http从angular controller登录到节点后端,如

  app.get('/auth/:connection', function(req, res, next) {

    passport.authenticate('auth0', {connection: req.params.connection}, function(err, user, info) {

    }) (req, res, next);
  });
不能在XHR上执行OAuth。您需要执行
window.location.pathname='/auth/whatever'
window.open('/auth/whatever')