I got it worked! But not only the problem of table fields(even though `password` field is required with hashed value).
The main problem is the html file. Let me say, I have input elements which their values of `name` attribute are `email` and `password`. But I have tried half a day to look over through the ctp way from source code those generated at runtime, in which are `data[User][email]` and `data[User][password]`. So, I change my attribute values in the html file to the `data[User][xxxx]` format, works like a charm \^o^/ Thanks for you all help. Best regards, tech_me. On Thursday, February 12, 2015 at 5:27:00 AM UTC+9, John Andersen wrote: > > Ah, I see your problem :) > > Please ensure that your users table has at least these columns: > id, username, password > > The id column is just the primary key for the table and CakePHP uses the > id to identify records in the table. > > Auth will use the username and password columns to identify the user who > logs in. > > Yes, password should be 40 characters long when using that password hasher. > > Please correct your users table and see if it now solves your issue. > Please also inform back here so other having the same issue may know. > > Thanks and enjoy, John > > > On Wednesday, 11 February 2015 10:06:16 UTC+2, tech_me wrote: >> >> Hi John, >> >> Sorry for replying late. >> I have been very busing recently and have less time to continue on this >> issue. >> >> Today I make some time to try your solution, got a good result and a bad >> one: >> - GOOD >> `passwordHasher`, yes, it worked. >> It saved hashed password(123) against id(1001) to my table, which is >> **f034a6b0709eb2b2bd1b2eb47987ab6e334ca7a6**(40 chars?!) >> >> - BAD >> Nothing changed, `$this->Auth->login()` still returning `false`. >> >> >> ADDITIONAL >> I have two input elements in my html(with PHPTAL), theirs `name` >> attributes are `username` and `password`, >> while there are `id` and 'password' fields in my table. >> So >> ` >> ... >> 'authenticate' => array( >> 'Form' => array('userModel' => 'User', >> 'fields' => array('username' => 'id', >> 'password' => 'password'))), >> ... >> ` >> is there anything incorrect? >> >> Thank you, tech_me >> >> [snip] >> > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups "CakePHP" group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.