I m trying to use Passportjs with Angular and express. I am trying to test facebook strategy in passportjs.
The authentications seems to succeed but does not navigate to the callback url. It simplay hangs.
Firebug console shows : GET http:// localhost:7000/auth/facebook 302 Moved Temporarily"
it however opens the callback url (index) successfully in the browser window when i manually click this url but not automatically redirecting
my login view ( jade ) looks as below :
a(href='/auth/facebook')
p Login
and the serverside routes is :
app.get('/auth/facebook', passport.authenticate('facebook'));
app.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/login' }),
function(req, res) {
res.render('index');
});
Kindly help. This is my first experience with Angularjs & Node js
EDIT : To be more precise , The issue only happens if my request is from client side ( login page in Angular ) to my express server. There is no issue if I serve the login page from within express. The authentication goes through fine and redirects to my applicatin as expected.
Can we not make the authentication request from client side ( using http get / post ) to the server while the server handles the authentication using passportjs ?