public authenticate ( string $username, string $password ) : AppserverIo\Security\PrincipalInterface | null | ||
$username | string | The name of the user to authenticate |
$password | string | The password used for authentication |
return | AppserverIo\Security\PrincipalInterface | null | The authenticated user principal |
public function authenticate(string $username, string $password)
{
// prepare the callback handler
$callbackHandler = new SecurityAssociationHandler(new SimplePrincipal($username), $password);
// authenticate the passed username/password combination
return $this->authenticateByUsernameAndCallbackHandler($username, $callbackHandler);
}