UserAuthenticationProvider
in package
implements
AuthenticationProviderInterface
UserProviderInterface retrieves users for UsernamePasswordToken tokens.
Tags
Interfaces, Classes, Traits and Enums
- AuthenticationProviderInterface
- AuthenticationProviderInterface is the interface for all authentication providers.
Table of Contents
- $hideUserNotFoundExceptions : mixed
- $providerKey : mixed
- $userChecker : mixed
- __construct() : mixed
- authenticate() : mixed
- {@inheritdoc}
- supports() : bool
- Checks whether this provider supports the given token.
- checkAuthentication() : mixed
- Does additional checks on the user and token (like validating the credentials).
- retrieveUser() : UserInterface
- Retrieves the user from an implementation-specific location.
- getRoles() : array<string|int, mixed>
- Retrieves roles from user and appends SwitchUserRole if original token contained one.
Properties
$hideUserNotFoundExceptions
private
mixed
$hideUserNotFoundExceptions
$providerKey
private
mixed
$providerKey
$userChecker
private
mixed
$userChecker
Methods
__construct()
public
__construct(UserCheckerInterface $userChecker, string $providerKey[, bool $hideUserNotFoundExceptions = true ]) : mixed
Parameters
- $userChecker : UserCheckerInterface
- $providerKey : string
- $hideUserNotFoundExceptions : bool = true
Tags
Return values
mixed —authenticate()
{@inheritdoc}
public
authenticate(TokenInterface $token) : mixed
Parameters
- $token : TokenInterface
Return values
mixed —supports()
Checks whether this provider supports the given token.
public
supports(TokenInterface $token) : bool
Parameters
- $token : TokenInterface
Return values
bool —true if the implementation supports the Token, false otherwise
checkAuthentication()
Does additional checks on the user and token (like validating the credentials).
protected
abstract checkAuthentication(UserInterface $user, UsernamePasswordToken $token) : mixed
Parameters
- $user : UserInterface
- $token : UsernamePasswordToken
Tags
Return values
mixed —retrieveUser()
Retrieves the user from an implementation-specific location.
protected
abstract retrieveUser(string $username, UsernamePasswordToken $token) : UserInterface
Parameters
- $username : string
-
The username to retrieve
- $token : UsernamePasswordToken
Tags
Return values
UserInterface —The user
getRoles()
Retrieves roles from user and appends SwitchUserRole if original token contained one.
private
getRoles(UserInterface $user, TokenInterface $token) : array<string|int, mixed>
Parameters
- $user : UserInterface
- $token : TokenInterface