Closed nick-konovalchuk closed 6 months ago
Hi @nick-konovalchuk, yes hashes will be different each time you hash them. I recommend you uninstall/reinstall bcrypt, or even better create a new environment and install the required libraries from scratch.
Didn't help
@nick-konovalchuk Not sure if you got this sorted out, but just to confirm, you should log in with jsmith (the parent label in the config). This tripped me up, at first I was trying the email address as username.
I faced now the exact same issue.
I literally copied the code from the example, but I can't login with the following credentials:
username: jsmith
password: abc
I also rehashed the password, but it did not work with the new hash as well.
This is my config.yaml
credentials:
usernames:
jsmith:
email: jsmith@gmail.com
name: John Smith
password: $2b$12$V7bsVRB2Zq3KBiDHLRngeO5xOPsMDWoBThHlk.xjbVJdXaINte6ge
rbriggs:
email: rbriggs@gmail.com
name: Rebecca Briggs
password: $2b$12$lMbvWK7CvK3G7nt6k6W0AOzwytawknjq5Vf6UrVjubv3B48kx/EWu
cookie:
expiry_days: 30
key: some_signature_key # Must be string
name: some_cookie_name
preauthorized:
emails:
- melsby@gmail.com
What do I miss?
Well it turned out that I needed to restart my computer.. Now it works :D
I've literally copied and pasted code from ReadMe
Used
hashed_passwords = stauth.Hasher(['abc', 'def']).generate()
to get the hashed passwords, so my config file ended up being following:I'm failing to login with John Smith, abc.
stauth.Hasher
generates different hashes every time. Is it expected?