-
Notifications
You must be signed in to change notification settings - Fork 392
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
CakePHP 3.0 Authentication #66
Comments
what is not working exactly? Password hasher were recently changed in 3.0, you may want to take a look at the auth tutorial again and perhaps manually reset passwords for your current database if it is an option for you. In the future, please open tickets in cakephp/cakephp |
I am not able to login after submit on login button, always going in else part. |
Can you debug if the hashed password match? Go into the BaseAuthenticate class and debug the hashed password value and compared to the one in the database |
I found the bug, which is in FormAuthenticate class. _checkFields of FormAuthenticate class return false because of username field(In my form it is email). but I already mention in app controller for email field instead of username. |
The problem was in your config
you are missing the
|
problem is in $this->passwordHasher()->check($password, $result[$fields['password']]) function which is in BaseAuthenticate class. |
Can you go into the hasher code and compare what it produces versus what you have stored in the database? |
Yes I did it and I found record in database. It is also returning result in $result variable. |
you're still not answering my question, how does the password stored in your database compare to what the password hasher is producing? |
I stored password in blowfish hash code which is 50 char. |
can you paste here the password stored in your database and the one that is checked in the password hasher class? |
In database : |
ok, I got it. |
Both passwords are the same, how come the password checker returns false then? Can you help us debug that? |
If you are using the laters CakePHP 3.0, please use SimplePasswordHasher instead of Blowfish |
As you suggested me, I switched from Blowfish to SimplePasswordHasher. But still authentication is not working because password is not matching.following code returning false. password return by hasher : My updated gist link is: |
You DB column is probably too short, bcrypt hashes are much longer than sha1's. If you are using a fixed length column they will be truncated. |
Thank you very much. Now its working. |
I am able to add user but still Auth login is not working.
link of gist is following
https://gist.github.com/archanavhire/1460ebc16a7510d8d589
The text was updated successfully, but these errors were encountered: