<?php

namespace Sitecake\Authentication\Authenticator;

use Sitecake\Authentication\AbstractAuthenticator;
use Sitecake\Http\Request;

class DefaultAuthenticator extends AbstractAuthenticator
{
    /**
     * Default configuration
     *
     * @var array
     */
    protected $defaultConfig = [
        'paramName' => 'credentials'
    ];

    public function authenticate(Request $request)
    {
        return $this->identifier->identify([
            'password' => $request->request->get($this->getConfig('paramName'))
        ]);
    }
}
