Saturday, June 27, 2009

Re: Auth->authenticate in beforeFilter causes Auth issues

I understand that you are using MD5 instead of SHA1 in your user
model!

If that is the final decision, then why don't you just tell CakePHP to
use MD5 as default and as shown in the example at:

http://book.cakephp.org/view/566/Change-Hash-Function

Maybe that would help you!
Enjoy,
John

On Jun 27, 10:37 am, Justin Poliey <jd...@njit.edu> wrote:
> Right now I'm using Cake's Auth component to build a simple user
> system. Pastes of the files in their entirety are availablehttp://gist.github.com/136935for reference.
>
> The problem is that when I call: $this->Auth->authenticate =
> ClassRegistry::init('User'), login.ctp always shows "Login failed.
> Invalid username or password." even when I haven't submitted anything.
> If I uncomment that line (line 10, users_controller.php) the message
> is suppressed but the login logic doesn't work, because it needs the
> hashedPasswords function in the User model to get the proper password
> hash. We need to use plain md5 hashes instead of Cake's regular hash
> because before converting to Cake all of our users just had plain md5
> hashed passwords.
>
> The strangest thing is that this happened before, and was solved by
> getting rid of all the relevant code, and then completely rewriting
> it. After the rewrite, it worked for a while, and then I must have
> done something to break it again. Can anyone see what is wrong? Am I
> doing something dumb and just not realizing it?
>
> Thanks for any help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: