-
Notifications
You must be signed in to change notification settings - Fork 99
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
gen_passwords.sh is not generating correct hashes #422
Comments
Hi @MrRagnar |
Hello!
I have tried using both And here is my
Using this config I am able to login using |
Sorry, I'm a bit confused. How did you generate the password sha for pekka? |
I used |
Sorry for taking so long to look at this. TLDR - blake's password in the example users.conf file is wrong. I've opened #435 to fix it. This is the code that is doing the password checking for file auth:
I get the same results as htpassword:
When I tried running with the default users.conf file, and with file auth enabled, I was not able to log in as blake, which further confirms my suspicion that the default user.conf file is wrong. When I added your I also created a new password with the gen_password script, and was able to auth using that password and the generated hash. I've opened #435 to fix blake's password in the example users.conf file. I'm not totally sure what happened in your test @MrRagnar - let me know if you cannot replicate these results, and I'll keep helping you track down the problem. Sorry again for taking so long to get back to this. |
Wow this was painful! I ran into the same problem I think, this is what I found: The sample configs like here are using auth.type = default, yet specifying a password file: https://github.com/tumblr/collins/blob/master/conf/authentication.conf#L3 Now the docs show the blake / admin:first credentials in the docs and the username in the file which makes you assume that file is actually used - but it's not. type = default uses some hardcoded credentials or whatever, not the specified file. Now people change the credentials in the file and wonder why they can't login with those new credentials... So I would suggest to get rid of the default / mock auth altogether. Or is there a reason to have it? By default collins should use auth = file which I assume would also work for tests. I'd also consider it best practice to hardcode any credentials, let alone ones you can actually use to login. Just imaging accidentally changing type back to default and exposing the setup with the default credentials. |
I have generated a user and password-hash and put them in the users.yml file but I keep getting
"Unable to login Invalid username or password" when I try to login.
Logging in as blake with the password admin:first works just fine.
To test, I generated the hash for that password using htpasswd:
This differs from the hash in the default users.yml file:
Am I missing something or is the gen_passwords.sh broken? (missing a function to add a salt maybe?)
The text was updated successfully, but these errors were encountered: