if (!
$passport->
hasBadge(PasswordCredentials::
class)) { throw new \
LogicException(sprintf('LDAP authentication requires a passport containing password credentials, authenticator "%s" does not fulfill these requirements.',
$event->
getAuthenticator()::
class));
} /** @var PasswordCredentials $passwordCredentials */
$passwordCredentials =
$passport->
getBadge(PasswordCredentials::
class);
if ($passwordCredentials->
isResolved()) { throw new \
LogicException('LDAP authentication password verification cannot be completed because something else has already resolved the PasswordCredentials.'
);
} if (!
$this->ldapLocator->
has($ldapBadge->
getLdapServiceId())) { throw new \
LogicException(sprintf('Cannot check credentials using the "%s" ldap service, as such service is not found. Did you maybe forget to add the "ldap" service tag to this service?',
$ldapBadge->
getLdapServiceId()));
} $presentedPassword =
$passwordCredentials->
getPassword();
if ('' ===
$presentedPassword) { throw new BadCredentialsException('The presented password cannot be empty.'
);
} $user =
$passport->
getUser();
/** @var LdapInterface $ldap */