Documentation

AppCustomAuthenticator extends AbstractLoginFormAuthenticator
in package
Uses TargetPathTrait

A base class to make form login authentication easier!

Table of Contents

Constants

LOGIN_ROUTE  = 'app_login'

Properties

$urlGenerator  : UrlGeneratorInterface

Methods

__construct()  : mixed
authenticate()  : Passport
createToken()  : TokenInterface
Shortcut to create a PostAuthenticationToken for you, if you don't really care about which authenticated token you're using.
isInteractive()  : bool
Should return true to make this authenticator perform an interactive login.
onAuthenticationFailure()  : Response
Override to change what happens after a bad username/password is submitted.
onAuthenticationSuccess()  : Response|null
start()  : Response
Override to control what happens when the user hits a secure page but isn't logged in yet.
supports()  : bool
{@inheritdoc}
getLoginUrl()  : string
Return the URL to the login page.
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.

Constants

Properties

Methods

createToken()

Shortcut to create a PostAuthenticationToken for you, if you don't really care about which authenticated token you're using.

public createToken(Passport $passport, string $firewallName) : TokenInterface
Parameters
$passport : Passport

The passport returned from authenticate()

$firewallName : string
Return values
TokenInterface

isInteractive()

Should return true to make this authenticator perform an interactive login.

public isInteractive() : bool
Return values
bool

supports()

{@inheritdoc}

public supports(Request $request) : bool

Override to change the request conditions that have to be matched in order to handle the login form submit.

This default implementation handles all POST requests to the login path (@see getLoginUrl()).

Parameters
$request : Request
Return values
bool

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