Angularjs 使用PassportJS+;访问linkedin信息不起作用;NodeJs+;有棱角的

Angularjs 使用PassportJS+;访问linkedin信息不起作用;NodeJs+;有棱角的,angularjs,node.js,Angularjs,Node.js,我正在Angular应用程序中实现Passportjs w/node,以检索用户的linkedIn信息,如姓名、当前位置等。。。下面是一个场景 用户尚未登录LinkedIn->将用户重定向到LinkedIn登录页面。(太好了!) 用户已登录LinkedIn->重定向至页面,显示“LinkedIn验证失败”(WTF?) 代码: 在我的角度控制器中单击按钮时: $scope.verifyLinkedIn = function(){ $window.location.href = '/auth/l

我正在Angular应用程序中实现Passportjs w/node,以检索用户的linkedIn信息,如姓名、当前位置等。。。下面是一个场景

用户尚未登录LinkedIn->将用户重定向到LinkedIn登录页面。(太好了!)

用户已登录LinkedIn->重定向至页面,显示“LinkedIn验证失败”(WTF?)

代码:

在我的角度控制器中单击按钮时:

$scope.verifyLinkedIn = function(){
  $window.location.href = '/auth/linkedin' ;
};
这就是我的node routes.js文件对于linkedIn Passport的外观:

{
    path: '/auth/linkedin',
    httpMethod: 'GET',
    middleware: [passport.authenticate('linkedin', {
        successRedirect: '/edit_roommate',
        failureRedirect: '/edit_roommate'
    })]
},
{
    path: '/auth/linkedin/callback',
    httpMethod: 'GET',
    middleware: [function (req, res) {
        console.log('/auth/linkedin/callback - req.url: ' + req.url);
        AuthCtrl.loginWithLinkedIn(req, res, function(err, res)
        {
            console.log('done!');
            //res.render('search');
        });
    }]
},
从页面上的这一点重定向到:

http://www.apartmate.com/auth/linkedin/callback?code=AQQ9UPfnVSTlaHv8OYzPdnIcIt0KtpGW7OCbv3ngolCoR3mWGNADymFwGckWEU7RB1VMthn77ILPaxHtlO3N9Kx-NghPtGbGrIYxkyAzZzyNdZM-Fv8&state=vSMzPEsAQhviuHqgF8xEGhfQ
页面上写着“LinkedIn验证失败”,控制台被清除。我错过什么了吗?我的实现不正确吗?任何帮助都将不胜感激。谢谢