# Need Help with authentication plugin

**URL:** <https://discourse.cakephp.org/t/need-help-with-authentication-plugin/6089>\
**Category:** Plugins\
**Created:** [May 16, 2019, 2:16am UTC](https://discourse.cakephp.org/t/need-help-with-authentication-plugin/6089 "2019-05-16T02:16:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![farid](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@farid](https://discourse.cakephp.org/u/farid)\
**Post date:** [May 16, 2019, 2:16am UTC](https://discourse.cakephp.org/t/need-help-with-authentication-plugin/6089/1 "2019-05-16T02:16:43Z")

</div>

i try authetication plugin from cookbook but can not login, when i try to debug

> object(Authentication\Authenticator\Result) {  
> [protected] \_status =\> ‘FAILURE\_CREDENTIALS\_MISSING’  
> [protected] \_data =\> null  
> [protected] \_errors =\> [  
> (int) 0 =\> ‘Login credentials not found’  
> ]  
> }

need sample with from  
CMS Tutorial - Authentication (but with authentication plugin, not Auth Component )

This is my authentication config

```auto
 $service = new AuthenticationService();
    
    $service->loadIdentifier('Authentication.Password', [
        'fields' => [
            'username' => [
                'username',
                'email'
            ],
            'password' => 'password'
        ],
        'resolver' => [
            'className' => 'Authentication.Orm',
            'userModel' => 'CoreDev/Data/User.Siteuser'
        ],
        'passwordHasher' => [
            'className' => 'Authentication.Fallback',
            'hashers' => [
                [
                    'Authentication.Default'
                ],
                [
                    'className' => 'Authentication.Legacy',
                    'hashType' => 'md5'
                ]
            ]
        ]
    ]);

    // Load the authenticators, you want session first
    $service->loadAuthenticator('Authentication.Session');
    $service->loadAuthenticator('Authentication.Form', [
          'fields' => [
            'username' => [
                 'username',
                'email'
            ],
            'password' => 'password'
        ],
        'loginUrl' => '/user/login'
    ]);

    return $service;
```
