AppserverIo\Appserver\ServletEngine\Authenticator\FormAuthenticator::onCredentials PHP Method

onCredentials() protected method

Will be invoked to load the credentials from the request.
protected onCredentials ( AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest, AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface $servletResponse ) : void
$servletRequest AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The servlet request instance
$servletResponse AppserverIo\Psr\Servlet\Http\HttpServletResponseInterface The servlet response instance
return void
    protected function onCredentials(HttpServletRequestInterface $servletRequest, HttpServletResponseInterface $servletResponse)
    {
        // try to load username and password from the request instead
        if ($servletRequest->hasParameter(FormKeys::USERNAME) && $servletRequest->hasParameter(FormKeys::PASSWORD)) {
            // load username/password from the request
            $this->username = new String($servletRequest->getParameter(FormKeys::USERNAME));
            $this->password = new String($servletRequest->getParameter(FormKeys::PASSWORD));
        }
    }