node.js - Response returns a 302 instead of a 401 http status -
i'm building rest api using express , want add authetication app. on client side have angularjs application.
i have code authentication request
app.get('/auth/google', passport.authenticate('google'));
but code returns 302 http status, isn't helpful in rest api application. guess 401 status code more helpful.
i have installed passport-google 0.3
am missing here ?
i doubt passport-google
has been intended used rest api.
302
redirect status code. passport-google
expects /auth/google
page has been opened in browser, it's redirecting user google.com authentication dialog.
try opening in browser , happen.
update:
i have feeling picked wrong tool. @ passport-localapikey
module, or search other rest authentication solution.
i don't think you'll able use passport-google
pure rest api without hacking (e.g. monkey-patching internal parts).
Comments
Post a Comment