LoginFormAuthenticator
extends AbstractFormLoginAuthenticator
in package
implements
PasswordAuthenticatedInterface
Uses
TargetPathTrait
A base class to make form login authentication easier!
Interfaces, Classes, Traits and Enums
- PasswordAuthenticatedInterface
- An optional interface for "guard" authenticators that deal with user passwords.
Table of Contents
- LOGIN_ROUTE = 'app_login'
- $csrfTokenManager : mixed
- $entityManager : mixed
- $passwordEncoder : mixed
- $urlGenerator : mixed
- __construct() : mixed
- checkCredentials() : mixed
- createAuthenticatedToken() : PostAuthenticationGuardToken
- Shortcut to create a PostAuthenticationGuardToken for you, if you don't really care about which authenticated token you're using.
- getCredentials() : mixed
- getPassword() : string|null
- Used to upgrade (rehash) the user's password automatically over time.
- getUser() : mixed
- onAuthenticationFailure() : RedirectResponse
- Override to change what happens after a bad username/password is submitted.
- onAuthenticationSuccess() : mixed
- start() : RedirectResponse
- Override to control what happens when the user hits a secure page but isn't logged in yet.
- supports() : mixed
- supportsRememberMe() : mixed
- 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
LOGIN_ROUTE
public
mixed
LOGIN_ROUTE
= 'app_login'
Properties
$csrfTokenManager
private
mixed
$csrfTokenManager
$entityManager
private
mixed
$entityManager
$passwordEncoder
private
mixed
$passwordEncoder
$urlGenerator
private
mixed
$urlGenerator
Methods
__construct()
public
__construct(EntityManagerInterface $entityManager, UrlGeneratorInterface $urlGenerator, CsrfTokenManagerInterface $csrfTokenManager, UserPasswordEncoderInterface $passwordEncoder) : mixed
Parameters
- $entityManager : EntityManagerInterface
- $urlGenerator : UrlGeneratorInterface
- $csrfTokenManager : CsrfTokenManagerInterface
- $passwordEncoder : UserPasswordEncoderInterface
Return values
mixed —checkCredentials()
public
checkCredentials(mixed $credentials, UserInterface $user) : mixed
Parameters
- $credentials : mixed
- $user : UserInterface
Return values
mixed —createAuthenticatedToken()
Shortcut to create a PostAuthenticationGuardToken for you, if you don't really care about which authenticated token you're using.
public
createAuthenticatedToken(UserInterface $user, string $providerKey) : PostAuthenticationGuardToken
Parameters
- $user : UserInterface
- $providerKey : string
Return values
PostAuthenticationGuardToken —getCredentials()
public
getCredentials(Request $request) : mixed
Parameters
- $request : Request
Return values
mixed —getPassword()
Used to upgrade (rehash) the user's password automatically over time.
public
getPassword(mixed $credentials) : string|null
Parameters
- $credentials : mixed
-
The user credentials
Return values
string|null —getUser()
public
getUser(mixed $credentials, UserProviderInterface $userProvider) : mixed
Parameters
- $credentials : mixed
- $userProvider : UserProviderInterface
Return values
mixed —onAuthenticationFailure()
Override to change what happens after a bad username/password is submitted.
public
onAuthenticationFailure(Request $request, AuthenticationException $exception) : RedirectResponse
Parameters
- $request : Request
- $exception : AuthenticationException
Return values
RedirectResponse —onAuthenticationSuccess()
public
onAuthenticationSuccess(Request $request, TokenInterface $token, mixed $providerKey) : mixed
Parameters
- $request : Request
- $token : TokenInterface
- $providerKey : mixed
Return values
mixed —start()
Override to control what happens when the user hits a secure page but isn't logged in yet.
public
start(Request $request[, AuthenticationException $authException = null ]) : RedirectResponse
Parameters
- $request : Request
- $authException : AuthenticationException = null
Return values
RedirectResponse —supports()
public
supports(Request $request) : mixed
Parameters
- $request : Request
Return values
mixed —supportsRememberMe()
public
supportsRememberMe() : mixed
Return values
mixed —getLoginUrl()
Return the URL to the login page.
protected
getLoginUrl() : string
Return values
string —getTargetPath()
Returns the URL (if any) the user visited that forced them to login.
private
getTargetPath(SessionInterface $session, string $providerKey) : string|null
Parameters
- $session : SessionInterface
- $providerKey : string
Return values
string|null —removeTargetPath()
Removes the target path from the session.
private
removeTargetPath(SessionInterface $session, string $providerKey) : mixed
Parameters
- $session : SessionInterface
- $providerKey : string
Return values
mixed —saveTargetPath()
Sets the target path the user should be redirected to after authentication.
private
saveTargetPath(SessionInterface $session, string $providerKey, string $uri) : mixed
Usually, you do not need to set this directly.
Parameters
- $session : SessionInterface
- $providerKey : string
- $uri : string