I am trying to set up the new Authencation method from CakepHP. When logging in I get the message in debug that the credentials are missing. In the request POST data the email and password fields are submitted. Am I missing something?

```
    /**
     * Login method
     */
    public function login()
    {
        $result = $this->Authentication->getResult();

        // regardless of POST or GET, redirect if user is logged in
        if ($result->isValid()) {
            $redirect = $this->request->getQuery('redirect', ['controller' => 'Pages', 'action' => 'display', 'home']);
            return $this->redirect($redirect);
        }

        // display error if user submitted and authentication failed
        if ($this->request->is(['post']) && !$result->isValid()) {
            $this->Flash->error('Invalid username or password');
        }
    }

public function getAuthenticationService(ServerRequestInterface $request, ResponseInterface $response)
    {
        $service = new AuthenticationService();

        $fields = [
            'username' => 'email',
            'password' => 'password'
        ];

        // Load identifiers
        $service->loadIdentifier('Authentication.Password', compact('fields'));

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

        return $service;
    }

```

EDIT: After editing the Form Authenticator options with the username/post field I get the following

> 
> error: FAILURE\_IDENTITY\_NOT\_FOUND
> 
> 
> 

The SQL debug says the record is found in the Users table.

```
SELECT 
  Users.id AS `Users__id`, 
  Users.email AS `Users__email`, 
  Users.password AS `Users__password`, 
  Users.role AS `Users__role`, 
  Users.created AS `Users__created`, 
  Users.modified AS `Users__modified` 
FROM 
  users Users 
WHERE 
  Users.email = 'my@my.com' 
LIMIT 
  1

```

Users table structure

```
id Primary key  int(11)
email   varchar(255)    utf8mb4_general_ci
password    varchar(255)    utf8mb4_general_ci
role    varchar(255)
created datetime
modified    datetime

```