# Login fails .$this-\>Auth-\>identify() returning false

**URL:** <https://discourse.cakephp.org/t/login-fails-this-auth-identify-returning-false/2829>\
**Category:** Need Help\
**Created:** [July 4, 2017, 6:01am UTC](https://discourse.cakephp.org/t/login-fails-this-auth-identify-returning-false/2829 "2017-07-04T06:01:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![trishnaullas](https://avatars.discourse-cdn.com/v4/letter/t/7ab992/32.png) [@trishnaullas](https://discourse.cakephp.org/u/trishnaullas)\
**Post date:** [July 4, 2017, 6:01am UTC](https://discourse.cakephp.org/t/login-fails-this-auth-identify-returning-false/2829/1 "2017-07-04T06:01:17Z")

</div>

Hi,  
I am new in cakephp. i have an issue with login section.when login ,$this-\>Auth-\>identify() returning false so no able to login for right credential as well.i tried one solution that increasing the password field length but that also not working.  
could you please help me?

thanks,  
Trishna

---

<div class="post-metadata">

**Author:** ![Diego](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/diego/32/296_2.png) [@Diego](https://discourse.cakephp.org/u/Diego)\
**Post date:** [July 4, 2017, 10:47am UTC](https://discourse.cakephp.org/t/login-fails-this-auth-identify-returning-false/2829/2 "2017-07-04T10:47:25Z")

</div>

post your code please or we cant get a clue whats going wrong, UserController.php, AppController.php

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [July 5, 2017, 12:43pm UTC](https://discourse.cakephp.org/t/login-fails-this-auth-identify-returning-false/2829/3 "2017-07-05T12:43:44Z")

</div>

The most common error is around hashing. Are you sure that your password is hashed and you are comparing against that?

Anyway the easiest way to handle to whole story is using this plugin: [https://github.com/CakeDC/users/](https://github.com/CakeDC/users/)

Otherwise as @Diego mentioned we would need to see your code.
