AuthenticationProviderManager
class AuthenticationProviderManager implements AuthenticationManagerInterface (View source)
The default authentication manager, which relies on Authentication Providers to authenticate the tokens stored in the security context.
Properties
protected SessionManagerInterface | $sessionManager | ||
protected TokenAndProviderFactoryInterface | $tokenAndProviderFactory | ||
protected Context | $securityContext | The security context of the current request |
|
protected array|null | $providerConfigurations | Injected configuration for providers. |
|
protected bool | $isAuthenticated | ||
protected bool | $isInitialized | ||
protected string | $authenticationStrategy |
Methods
Inject the settings and does a fresh build of tokens based on the injected settings
Returns the security context
Tries to authenticate the tokens in the security context (in the given order) with the available authentication providers, if needed.
Checks if one or all tokens are authenticated (depending on the authentication strategy).
Logout all active authentication tokens
Signals that the specified token has been successfully authenticated.
Signals that all active authentication tokens have been invalidated.
Signals that authentication commenced and at least one token was authenticated.
Details
__construct(TokenAndProviderFactoryInterface $tokenAndProviderFactory)
No description
void
injectSettings(array $settings)
Inject the settings and does a fresh build of tokens based on the injected settings
Context
getSecurityContext()
Returns the security context
void
authenticate()
Tries to authenticate the tokens in the security context (in the given order) with the available authentication providers, if needed.
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.
bool
isAuthenticated()
Checks if one or all tokens are authenticated (depending on the authentication strategy).
Will call authenticate() if not done before.
void
logout()
Logout all active authentication tokens
protected void
emitAuthenticatedToken(TokenInterface $token)
Signals that the specified token has been successfully authenticated.
protected void
emitLoggedOut()
Signals that all active authentication tokens have been invalidated.
Note: the session will be destroyed after this signal has been emitted.
protected void
emitSuccessfullyAuthenticated()
Signals that authentication commenced and at least one token was authenticated.