Ejemplo n.º 1
0
 /**
  * Calls the authentication manager to authenticate all active tokens
  * and redirects to the original intercepted request on success if there
  * is one stored in the security context. If no intercepted request is
  * found, the function simply returns.
  *
  * If authentication fails, the result of calling the defined
  * $errorMethodName is returned.
  *
  * @return string
  */
 public function authenticateAction()
 {
     $authenticated = FALSE;
     try {
         $this->authenticationManager->authenticate();
         $authenticated = TRUE;
     } catch (\TYPO3\FLOW3\Security\Exception\AuthenticationRequiredException $exception) {
     }
     if ($authenticated) {
         $storedRequest = $this->securityContext->getInterceptedRequest();
         if ($storedRequest !== NULL) {
             $mainRequest = $storedRequest->getMainRequest();
             $packageKey = $mainRequest->getControllerPackageKey();
             $subpackageKey = $mainRequest->getControllerSubpackageKey();
             if ($subpackageKey !== NULL) {
                 $packageKey .= '\\' . $subpackageKey;
             }
             $this->redirect($mainRequest->getControllerActionName(), $mainRequest->getControllerName(), $packageKey, $mainRequest->getArguments());
         }
     } else {
         return call_user_func(array($this, $this->errorMethodName));
     }
 }