In Symfony 4, the AuthenticatorInterface::supports()
method has the following comment:
interface AuthenticatorInterface extends AuthenticationEntryPointInterface
{
/**
* Does the authenticator support the given Request?
*
* If this returns false, the authenticator will be skipped.
*
* @param Request $request
*
* @return bool
*/
public function supports(Request $request);
I find the phrasing confusing. My first instinct when I tried implementing this was to return true if the request contains a username
and password
field, but then I remembered that all the requests I am receiving are getting authenticated, even if i am not using the login form.
Is the supports()
method a way to override the security.firewalls.myFirewall.pattern
argument? Is it a thing that handles the flow between multiple authenticators?
How should I use this interface?