passport-local
passport-local copied to clipboard
Force authentication without a request?
Hi there, I've been using passport for a while and now stumbled upon this weird thing - it seems I cannot authenticate an user, from the code, without actually posting all the credentials from web. Is that correct?
The more I browse the authentication strategies and how they work, the more I end up in the passport framework (I use the standard connect style) and I just get here.
So, is there any way I can simply use something like:
passport.authenticate('local', { user: 'username', pass: 'pass', }, function callback(){ });
It seems to me pretty needy. Right now I'm changing my db, and haven't yet updated my login functionality, but I have to drop everything and start doing all those views and stuff, just to get logged in with any user..
Thanks in advance! :)
Just call req.login(user)
Sent from my iPhone
On Aug 28, 2015, at 2:42 AM, fourpixels [email protected] wrote:
Hi there, I've been using passport for a while and now stumbled upon this weird thing - it seems I cannot authenticate an user, from the code, without actually posting all the credentials from web. Is that correct?
The more I browse the authentication strategies and how they work, the more I end up in the passport framework (I use the standard connect style) and I just get here.
So, is there any way I can simply use something like:
passport.authenticate('local', { user: 'username', pass: 'pass', }, function callback(){ }); It seems to me pretty needy. Right now I'm changing my db, and haven't yet updated my login functionality, but I have to drop everything and start doing all those views and stuff, just to get logged in with any user..
Thanks in advance! :)
— Reply to this email directly or view it on GitHub.
Well this also implies that I have a request. I guess I'm too lazy because all I wanted is to have logged in user with stored session once I start my server :-$
I guess I'll send an empty request to a page that just uses authenticate or login. Thanks for the help.
How would you have a session without a request?