PHP Class Neos\Flow\Security\Authentication\Controller\AbstractAuthenticationController

Inheritance: extends Neos\Flow\Mvc\Controller\ActionController
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$authenticationManager Neos\Flow\Security\Authentication\AuthenticationManagerInterface
$securityContext Neos\Flow\Security\Context

Méthodes publiques

Méthode Description
authenticateAction ( ) : string 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.
loginAction ( ) : void This action is used to show the login form. To make this work in your package simply create a template for this action, which could look like this in the simplest case:
logoutAction ( ) : void Logs all active tokens out. Override this, if you want to have some custom action here. You can always call the parent method to do the actual logout.

Méthodes protégées

Méthode Description
getErrorFlashMessage ( ) : Neos\Error\Messages\Error A template method for displaying custom error flash messages, or to display no flash message at all on errors. Override this to customize the flash message in your action controller.
onAuthenticationFailure ( AuthenticationRequiredException $exception = null ) : void Is called if authentication failed.
onAuthenticationSuccess ( ActionRequest $originalRequest = null ) : string Is called if authentication was successful. If there has been an intercepted request due to security restrictions, you might want to use something like the following code to restart the originally intercepted request:

Method Details

authenticateAction() public méthode

If authentication fails, the result of calling the defined $errorMethodName is returned. Note: Usually there is no need to override this action. You should use the according callback methods instead (onAuthenticationSuccess() and onAuthenticationFailure()).
public authenticateAction ( ) : string
Résultat string

getErrorFlashMessage() protected méthode

Note: If you implement a nice redirect in the onAuthenticationFailure() method of you login controller, this message should never be displayed.
protected getErrorFlashMessage ( ) : Neos\Error\Messages\Error
Résultat Neos\Error\Messages\Error The flash message

loginAction() public méthode

Note: This example is designed to serve the "UsernamePassword" token.
public loginAction ( ) : void
Résultat void

logoutAction() public méthode

Logs all active tokens out. Override this, if you want to have some custom action here. You can always call the parent method to do the actual logout.
public logoutAction ( ) : void
Résultat void

onAuthenticationFailure() protected méthode

Override this method in your login controller to take any custom action for this event. Most likely you would want to redirect to some action showing the login form again.
protected onAuthenticationFailure ( AuthenticationRequiredException $exception = null ) : void
$exception Neos\Flow\Security\Exception\AuthenticationRequiredException The exception thrown while the authentication process
Résultat void

onAuthenticationSuccess() abstract protected méthode

if ($originalRequest !== NULL) { $this->redirectToRequest($originalRequest); } $this->redirect('someDefaultActionAfterLogin');
abstract protected onAuthenticationSuccess ( ActionRequest $originalRequest = null ) : string
$originalRequest Neos\Flow\Mvc\ActionRequest The request that was intercepted by the security framework, NULL if there was none
Résultat string

Property Details

$authenticationManager protected_oe property

protected AuthenticationManagerInterface,Neos\Flow\Security\Authentication $authenticationManager
Résultat Neos\Flow\Security\Authentication\AuthenticationManagerInterface

$securityContext protected_oe property

protected Context,Neos\Flow\Security $securityContext
Résultat Neos\Flow\Security\Context