/**
* Returns the username of the pre-authenticated user.
*
* This authenticator is skipped if null is returned or a custom
* BadCredentialsException is thrown.
*/
abstract protected function extractUsername(Request
$request): ?string;
public function supports(Request
$request): ?bool
{ try { $username =
$this->
extractUsername($request);
} catch (BadCredentialsException
$e) { $this->
clearToken($e);
$this->logger?->
debug('Skipping pre-authenticated authenticator as a BadCredentialsException is thrown.',
['exception' =>
$e, 'authenticator' =>
static::
class]);
return false;
} if (null ===
$username) { $this->logger?->
debug('Skipping pre-authenticated authenticator no username could be extracted.',
['authenticator' =>
static::
class]);