PHP Class Neos\Flow\Security\Authentication\AuthenticationProviderManager

Inheritance: implements Neos\Flow\Security\Authentication\AuthenticationManagerInterface
显示文件 Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$isAuthenticated boolean
$providerResolver AuthenticationProviderResolver The provider resolver
$providers array
$requestPatternResolver Neos\Flow\Security\RequestPatternResolver The request pattern resolver
$securityContext Neos\Flow\Security\Context The security context of the current request
$securityLogger Neos\Flow\Log\SecurityLoggerInterface
$session Neos\Flow\Session\SessionInterface
$tokens array

Public Methods

Method Description
__construct ( AuthenticationProviderResolver $providerResolver, RequestPatternResolver $requestPatternResolver )
authenticate ( ) : void Tries to authenticate the tokens in the security context (in the given order) with the available authentication providers, if needed.
getProviders ( ) : array Returns all configured authentication providers
getSecurityContext ( ) : Context Returns the security context
getTokens ( ) : array Returns clean tokens this manager is responsible for.
injectSettings ( array $settings ) : void Inject the settings and does a fresh build of tokens based on the injected settings
isAuthenticated ( ) : boolean Checks if one or all tokens are authenticated (depending on the authentication strategy).
logout ( ) : void Logout all active authentication tokens
setSecurityContext ( Context $securityContext ) : void Sets the security context

Protected Methods

Method Description
buildProvidersAndTokensFromConfiguration ( array $providerConfigurations ) : void Builds the provider and token objects based on the given configuration
emitAuthenticatedToken ( Neos\Flow\Security\Authentication\TokenInterface $token ) : void Signals that the specified token has been successfully authenticated.
emitLoggedOut ( ) : void Signals that all active authentication tokens have been invalidated.

Method Details

__construct() public method

public __construct ( AuthenticationProviderResolver $providerResolver, RequestPatternResolver $requestPatternResolver )
$providerResolver AuthenticationProviderResolver The provider resolver
$requestPatternResolver Neos\Flow\Security\RequestPatternResolver The request pattern resolver

authenticate() public method

If the authentication strategy is set to "allTokens", all tokens have to be authenticated. If the strategy is set to "oneToken", only one token needs to be authenticated, but the authentication will stop after the first authenticated token. The strategy "atLeastOne" will try to authenticate at least one and as many tokens as possible.
public authenticate ( ) : void
return void

buildProvidersAndTokensFromConfiguration() protected method

Builds the provider and token objects based on the given configuration
protected buildProvidersAndTokensFromConfiguration ( array $providerConfigurations ) : void
$providerConfigurations array The configured provider settings
return void

emitAuthenticatedToken() protected method

Signals that the specified token has been successfully authenticated.
protected emitAuthenticatedToken ( Neos\Flow\Security\Authentication\TokenInterface $token ) : void
$token Neos\Flow\Security\Authentication\TokenInterface The token which has been authenticated
return void

emitLoggedOut() protected method

Note: the session will be destroyed after this signal has been emitted.
protected emitLoggedOut ( ) : void
return void

getProviders() public method

Returns all configured authentication providers
public getProviders ( ) : array
return array Array of \Neos\Flow\Security\Authentication\AuthenticationProviderInterface

getSecurityContext() public method

Returns the security context
public getSecurityContext ( ) : Context
return Neos\Flow\Security\Context $securityContext The security context of the current request

getTokens() public method

Note: The order of the tokens in the array is important, as the tokens will be authenticated in the given order.
public getTokens ( ) : array
return array Array of TokenInterface this manager is responsible for

injectSettings() public method

Inject the settings and does a fresh build of tokens based on the injected settings
public injectSettings ( array $settings ) : void
$settings array The settings
return void

isAuthenticated() public method

Will call authenticate() if not done before.
public isAuthenticated ( ) : boolean
return boolean

logout() public method

Logout all active authentication tokens
public logout ( ) : void
return void

setSecurityContext() public method

Sets the security context
public setSecurityContext ( Context $securityContext ) : void
$securityContext Neos\Flow\Security\Context The security context of the current request
return void

Property Details

$isAuthenticated protected_oe property

protected bool $isAuthenticated
return boolean

$providerResolver protected_oe property

The provider resolver
protected AuthenticationProviderResolver,Neos\Flow\Security\Authentication $providerResolver
return AuthenticationProviderResolver

$providers protected_oe property

protected array $providers
return array

$requestPatternResolver protected_oe property

The request pattern resolver
protected RequestPatternResolver,Neos\Flow\Security $requestPatternResolver
return Neos\Flow\Security\RequestPatternResolver

$securityContext protected_oe property

The security context of the current request
protected Context,Neos\Flow\Security $securityContext
return Neos\Flow\Security\Context

$securityLogger protected_oe property

protected SecurityLoggerInterface,Neos\Flow\Log $securityLogger
return Neos\Flow\Log\SecurityLoggerInterface

$session protected_oe property

protected SessionInterface,Neos\Flow\Session $session
return Neos\Flow\Session\SessionInterface

$tokens protected_oe property

protected array $tokens
return array