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

matchRequest() protected method

Does this request match the saved one, so that it must be the redirect we signaled after successful authentication?
protected matchRequest ( AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface $servletRequest ) : boolean
$servletRequest AppserverIo\Psr\Servlet\Http\HttpServletRequestInterface The servlet request instance
return boolean TRUE if the request matches the saved one, else FALSE
    protected function matchRequest(HttpServletRequestInterface $servletRequest)
    {
        // load the session from the request
        $session = $servletRequest->getSession();
        // query wheter or not a session is available
        if ($session == null) {
            return false;
        }
        // query whether or not we can find the original request data
        if ($session->hasKey(Constants::FORM_REQUEST) === false) {
            return false;
        }
        // if yes, compare the request URI and check for a valid princial
        if ($req = $session->getData(Constants::FORM_REQUEST)) {
            // query whether or not we've a valid princial
            if (isset($req->principal) === false) {
                return false;
            }
            // compare the request URI
            return $servletRequest->getRequestUri() === $req->requestUri;
        }
        // return FALSE if the request doesn't match
        return false;
    }