Facebookt认证Node.js

时间:2017-01-26 16:22:06

标签: node.js passport.js facebook-login

我遵循了本教程

https://scotch.io/tutorials/easy-node-authentication-facebook

通过我的网站处理facebook登录但我的身份验证有问题。

我收到以下错误: enter image description here

Node.js route.js

app.get('/login/callback', passport.authenticate('facebook', {  session: false, scope: [] }));

// handle the callback after facebook has authenticated the user
app.get('/login/callback',
    passport.authenticate('facebook', { session: false, failureRedirect: '/' }),
    function(req, res) {
        console.log('OOOOOOOKKKKKKK!');

        // Successful authentication, redirect home.
        try {
            res.redirect('/');
        } catch (e) {
            res.redirect('/');
        }
    });

auth.js文件

'facebookAuth' : {
    'clientID'        : '1721010571523140', // your App ID
    'clientSecret'    : '21769a433182378a103298a6ba91fefe', // your App Secret
    'callbackURL'     : '/login/callback'
}

HTML

<div class="row">
    <div class="col-md-12">
       <a href="/login/callback" class="btn btn-info btn-block"> <i class="icon-facebook" ></i> Login mit Facebook </a>
     </div>
</div>

我该如何解决这个问题?

0 个答案:

没有答案