Documentation

DefaultAuthenticationSuccessHandler
in package
implements AuthenticationSuccessHandlerInterface Uses TargetPathTrait

Class with the default authentication success handling logic.

Tags
author

Fabien Potencier fabien@symfony.com

author

Johannes M. Schmitt schmittjoh@gmail.com

author

Alexander iam.asm89@gmail.com

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]

Methods

getTargetPath()

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|null

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

        
On this page

Search results