GuardAuthenticatorInterface::getUser()

UserInterface|null getUser(mixed $credentials, UserProviderInterface $userProvider) Return a UserInterface object based on the credentials. The credentials are the return value from getCredentials() You may throw an AuthenticationException if you wish. If you return null, then a UsernameNotFoundException is thrown for you. Parameters mixed $credentials UserProviderInterface $userProvider Return Value UserInterface|null Exceptions AuthenticationException

GuardAuthenticatorInterface::getCredentials()

mixed|null getCredentials(Request $request) Get the authentication credentials from the request and return them as any type (e.g. an associate array). If you return null, authentication will be skipped. Whatever value you return here will be passed to getUser() and checkCredentials() For example, for a form login, you might: if ($request->request->has('_username')) { return array( 'username' => $request->request->get('_username'), 'password'

GuardAuthenticatorInterface

interface GuardAuthenticatorInterface implements AuthenticationEntryPointInterface The interface for all "guard" authenticators. The methods on this interface are called throughout the guard authentication process to give you the power to control most parts of the process from one location. Methods Response start(Request $request, AuthenticationException $authException = null) Returns a response that directs the user to authenticate. from AuthenticationEntryPointInterface mixed|null

GuardAuthenticatorHandler::handleAuthenticationFailure()

null|Response handleAuthenticationFailure(AuthenticationException $authenticationException, Request $request, GuardAuthenticatorInterface $guardAuthenticator, string $providerKey) Handles an authentication failure and returns the Response for the GuardAuthenticator. Parameters AuthenticationException $authenticationException Request $request GuardAuthenticatorInterface $guardAuthenticator string $providerKey The key of the firewall Return Value null|Response

GuardAuthenticatorHandler::handleAuthenticationSuccess()

null|Response handleAuthenticationSuccess(TokenInterface $token, Request $request, GuardAuthenticatorInterface $guardAuthenticator, string $providerKey) Returns the "on success" response for the given GuardAuthenticator. Parameters TokenInterface $token Request $request GuardAuthenticatorInterface $guardAuthenticator string $providerKey The provider (i.e. firewall) key Return Value null|Response

GuardAuthenticatorHandler::authenticateUserAndHandleSuccess()

Response|null authenticateUserAndHandleSuccess(UserInterface $user, Request $request, GuardAuthenticatorInterface $authenticator, string $providerKey) Convenience method for authenticating the user and returning the Response if any for success. Parameters UserInterface $user Request $request GuardAuthenticatorInterface $authenticator string $providerKey The provider (i.e. firewall) key Return Value Response|null

GuardAuthenticatorHandler::authenticateWithToken()

authenticateWithToken(TokenInterface $token, Request $request) Authenticates the given token in the system. Parameters TokenInterface $token Request $request

GuardAuthenticatorHandler

class GuardAuthenticatorHandler A utility class that does much of the work during the guard authentication process. By having the logic here instead of the listener, more of the process can be called directly (e.g. for manual authentication) or overridden. Methods __construct(TokenStorageInterface $tokenStorage, EventDispatcherInterface $eventDispatcher = null) authenticateWithToken(TokenInterface $token, Request $request) Authenticates the given token in the system. null|Respon

GuardAuthenticationProvider::supports()

bool supports(TokenInterface $token) Checks whether this provider supports the given token. Parameters TokenInterface $token A TokenInterface instance Return Value bool true if the implementation supports the Token, false otherwise

GuardAuthenticationProvider

class GuardAuthenticationProvider implements AuthenticationProviderInterface Responsible for accepting the PreAuthenticationGuardToken and calling the correct authenticator to retrieve the authenticated token. Methods __construct(array $guardAuthenticators, UserProviderInterface $userProvider, string $providerKey, UserCheckerInterface $userChecker) TokenInterface authenticate(TokenInterface $token) Finds the correct authenticator for the token and calls it. bool supports(Token