DefaultAuthenticationSuccessHandler
in package
implements
AuthenticationSuccessHandlerInterface
Uses
TargetPathTrait
Class with the default authentication success handling logic.
Tags
Table of Contents
Interfaces
- AuthenticationSuccessHandlerInterface
- Interface for a custom authentication success handler.
Properties
- $defaultOptions : mixed
- $firewallName : mixed
- $httpUtils : mixed
- $logger : mixed
- $options : mixed
Methods
- __construct() : mixed
- getFirewallName() : string|null
- getOptions() : array<string|int, mixed>
- Gets the options.
- onAuthenticationSuccess() : Response
- Usually called by AuthenticatorInterface::onAuthenticationSuccess() implementations.
- setFirewallName() : void
- setOptions() : mixed
- determineTargetUrl() : string
- Builds the target URL according to the defined options.
- getTargetPath() : string|null
- Returns the URL (if any) the user visited that forced them to login.
- removeTargetPath() : mixed
- Removes the target path from the session.
- saveTargetPath() : mixed
- Sets the target path the user should be redirected to after authentication.
Properties
$defaultOptions
protected
mixed
$defaultOptions
= ['always_use_default_target_path' => false, 'default_target_path' => '/', 'login_path' => '/login', 'target_path_parameter' => '_target_path', 'use_referer' => false]
$firewallName
protected
mixed
$firewallName
$httpUtils
protected
mixed
$httpUtils
$logger
protected
mixed
$logger
$options
protected
mixed
$options
Methods
__construct()
public
__construct(HttpUtils $httpUtils[, array<string|int, mixed> $options = [] ][, LoggerInterface $logger = null ]) : mixed
Parameters
- $httpUtils : HttpUtils
- $options : array<string|int, mixed> = []
-
Options for processing a successful authentication attempt
- $logger : LoggerInterface = null
getFirewallName()
public
getFirewallName() : string|null
Return values
string|nullgetOptions()
Gets the options.
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>onAuthenticationSuccess()
Usually called by AuthenticatorInterface::onAuthenticationSuccess() implementations.
public
onAuthenticationSuccess(Request $request, TokenInterface $token) : Response
Parameters
- $request : Request
- $token : TokenInterface
Return values
ResponsesetFirewallName()
public
setFirewallName(string $firewallName) : void
Parameters
- $firewallName : string
setOptions()
public
setOptions(array<string|int, mixed> $options) : mixed
Parameters
- $options : array<string|int, mixed>
determineTargetUrl()
Builds the target URL according to the defined options.
protected
determineTargetUrl(Request $request) : string
Parameters
- $request : Request
Return values
stringgetTargetPath()
Returns the URL (if any) the user visited that forced them to login.
private
getTargetPath(SessionInterface $session, string $firewallName) : string|null
Parameters
- $session : SessionInterface
- $firewallName : string
Return values
string|nullremoveTargetPath()
Removes the target path from the session.
private
removeTargetPath(SessionInterface $session, string $firewallName) : mixed
Parameters
- $session : SessionInterface
- $firewallName : string
saveTargetPath()
Sets the target path the user should be redirected to after authentication.
private
saveTargetPath(SessionInterface $session, string $firewallName, string $uri) : mixed
Usually, you do not need to set this directly.
Parameters
- $session : SessionInterface
- $firewallName : string
- $uri : string