public interface AuthenticationManager extends Action
AuthenticationContext
object as the InvokationContext.getClientContext()
.
Use AuthenticationContext.getLoginRequest()
to get information about the login
and password used for logging in.Modifier and Type | Method and Description |
---|---|
AuthenticatedUser |
authenticate()
Try to authenticate a user given the login information passed to
the factory in the
AuthenticationContext . |
default void |
vetoAuthenticatedUser(UserData user,
AuthenticatedUser auth)
This method is called if there are multiple installed external authentication
managers and at least one of them accepted the user in the
authenticate()
method. |
AuthenticatedUser authenticate()
AuthenticationContext
. There are three
outcomes from this method:
AuthenticatedUser
object should
be returned with at least the external id of the user.
AuthenticationException
(or a
subclass) should be thrown
AuthenticationException
- If the user was not authenticateddefault void vetoAuthenticatedUser(UserData user, AuthenticatedUser auth)
authenticate()
method. If so, all other authentication managers will get a chance to throw in
a veto. For example, an administrator account may be protected with a special
authentication manager (for example, YubiKey) while regular users by a simpler
method (for example, OTP). If the administrator tries to login with the OTP method
then the Yubikey authentication manager may veto this by throwing an
AuthenticationException
from this method.
Note that this method is NOT called on the authentication manager that authenticated
a user by returning information from the authenticate()
method.
To provide backwards compatibility with existing authentication managers this
method has a default implementation that doesn't do anything.user
- The user that is trying to loginauth
- Information about the authentication