Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to login user from a different app #131

Open
netlander opened this issue Apr 19, 2016 · 5 comments
Open

Unable to login user from a different app #131

netlander opened this issue Apr 19, 2016 · 5 comments

Comments

@netlander
Copy link

netlander commented Apr 19, 2016

Encountered an issue with passport local authentication policy using this plugin where I have registered a user on one express app but when I try to login the same user from a different app/site it seems not possible.

Tried also creating a user in the second app with the same result, i.e. not able to authenticate the new user in the first express app.

@netlander
Copy link
Author

Inherent problem with passport-local-mongoose whereby it's only useful for a single app deployment due I think to the salt/hash or whatever the plugin pushes to the database.

@riyadhzen
Copy link

Interesting, I launched my app on 2 different ports on the same machine and I can login from any app. So I really don't understand why you can't do the same.

@riyadhzen
Copy link

I just tested on 2 machines and everything is running OK.

@netlander
Copy link
Author

The problem occurs when deploying two or more completely different apps (not two instances of the same app).

@saintedlama
Copy link
Owner

May it be that the two different apps are running on two different node.js versions? In case this is true try to specify the digestAlgorithm in the app running on node.js >= 0.12 as sha1. Background: With node.js 0.12 the pbkdf2 crypto API in node.js got a new option for specifying digests. Since sha1, the old default, is not seen as too secure for this use case passport-local-mongoose decided to switch to sha256 as default in some newer versions. This results in the situation where app1 creates hashes with sha1 while app2 creates hashes with sha2. When comparing the hashes for the same password and salt these two will not match. Obviously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants