How to best store user information and user login and password

Don’t store passwords. If it’s ever sitting on a disk, it can be stolen. Instead, store password hashes. Use the right hashing algorithm, like bcrypt (which includes a salt).

EDIT: The OP has responded that he understands the above issue.

There’s no need to store the password in a physically different table from the login. If one database table is compromised, it’s not a large leap to access another table in that same database.

If you’re sufficiently concerned about security and security-in-depth, you might consider storing the user credentials in a completely separate data store from your domain data. One approach, commonly done, is to store credentials in an LDAP directory server. This might also help with any single-sign-on work you do later.

Leave a Comment