UsernamePasswordJsonAuthenticationListener
extends AbstractListener
in package
implements
ListenerInterface
Uses
LegacyListenerTrait
UsernamePasswordJsonAuthenticationListener is a stateless implementation of an authentication via a JSON document composed of a username and a password.
Tags
Interfaces, Classes, Traits and Enums
- ListenerInterface
- Interface that must be implemented by firewall listeners.
Table of Contents
- $authenticationManager : mixed
- $eventDispatcher : mixed
- $failureHandler : mixed
- $httpUtils : mixed
- $logger : mixed
- $options : mixed
- $propertyAccessor : mixed
- $providerKey : mixed
- $sessionStrategy : mixed
- $successHandler : mixed
- $tokenStorage : mixed
- __construct() : mixed
- __invoke() : mixed
- authenticate() : mixed
- Does whatever is required to authenticate the request, typically calling $event->setResponse() internally.
- setSessionAuthenticationStrategy() : mixed
- Call this method if your authentication token is stored to a session.
- supports() : bool|null
- Tells whether the authenticate() method should be called or not depending on the incoming request.
- migrateSession() : mixed
- onFailure() : Response
- onSuccess() : Response|null
Properties
$authenticationManager
private
mixed
$authenticationManager
$eventDispatcher
private
mixed
$eventDispatcher
$failureHandler
private
mixed
$failureHandler
$httpUtils
private
mixed
$httpUtils
$logger
private
mixed
$logger
$options
private
mixed
$options
$propertyAccessor
private
mixed
$propertyAccessor
$providerKey
private
mixed
$providerKey
$sessionStrategy
private
mixed
$sessionStrategy
$successHandler
private
mixed
$successHandler
$tokenStorage
private
mixed
$tokenStorage
Methods
__construct()
public
__construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, HttpUtils $httpUtils, string $providerKey[, AuthenticationSuccessHandlerInterface $successHandler = null ][, AuthenticationFailureHandlerInterface $failureHandler = null ][, array<string|int, mixed> $options = [] ][, LoggerInterface $logger = null ][, EventDispatcherInterface $eventDispatcher = null ][, PropertyAccessorInterface $propertyAccessor = null ]) : mixed
Parameters
- $tokenStorage : TokenStorageInterface
- $authenticationManager : AuthenticationManagerInterface
- $httpUtils : HttpUtils
- $providerKey : string
- $successHandler : AuthenticationSuccessHandlerInterface = null
- $failureHandler : AuthenticationFailureHandlerInterface = null
- $options : array<string|int, mixed> = []
- $logger : LoggerInterface = null
- $eventDispatcher : EventDispatcherInterface = null
- $propertyAccessor : PropertyAccessorInterface = null
Return values
mixed —__invoke()
public
final __invoke(RequestEvent $event) : mixed
Parameters
- $event : RequestEvent
Return values
mixed —authenticate()
Does whatever is required to authenticate the request, typically calling $event->setResponse() internally.
public
authenticate(RequestEvent $event) : mixed
Parameters
- $event : RequestEvent
Return values
mixed —setSessionAuthenticationStrategy()
Call this method if your authentication token is stored to a session.
public
setSessionAuthenticationStrategy(SessionAuthenticationStrategyInterface $sessionStrategy) : mixed
Parameters
- $sessionStrategy : SessionAuthenticationStrategyInterface
Tags
Return values
mixed —supports()
Tells whether the authenticate() method should be called or not depending on the incoming request.
public
supports(Request $request) : bool|null
Returning null means authenticate() can be called lazily when accessing the token storage.
Parameters
- $request : Request
Return values
bool|null —migrateSession()
private
migrateSession(Request $request, TokenInterface $token) : mixed
Parameters
- $request : Request
- $token : TokenInterface
Return values
mixed —onFailure()
private
onFailure(Request $request, AuthenticationException $failed) : Response
Parameters
- $request : Request
- $failed : AuthenticationException
Return values
Response —onSuccess()
private
onSuccess(Request $request, TokenInterface $token) : Response|null
Parameters
- $request : Request
- $token : TokenInterface