Authenticator (interface)

Represents an authentication mechanism capable of authenticating certain types of AuthenticationRequest and returning an Authentication if the credentials are valid.

There can be multiple Authenticator s registered. If so, all Authenticators that can authenticate any given AuthenticationRequest must

API

Authenticator.java
interface Authenticator {
  boolean canAuthenticate(Class<? extends AuthenticationRequest> authenticationRequestClass)     (1)
  Authentication authenticate(AuthenticationRequest request, String code)     (2)
  void logout(Authentication authentication)     (3)
}
1 canAuthenticate(Class)

Whether the provided AuthenticationRequest is recognized by this Authenticator .

2 authenticate(AuthenticationRequest, String)

Authenticates the provided AuthenticationRequest , returning a non-null Authentication if valid.

3 logout(Authentication)

Invalidates this Authentication , meaning that the user will need to log in again to use the application.

Members

canAuthenticate(Class)

Whether the provided AuthenticationRequest is recognized by this Authenticator .

authenticate(AuthenticationRequest, String)

Authenticates the provided AuthenticationRequest , returning a non-null Authentication if valid.

logout(Authentication)

Invalidates this Authentication , meaning that the user will need to log in again to use the application.