Authenticator

Represents an authentication mechanism capable of authenticating certain types of AuthenticationRequest and returning an InteractionContext 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)
  InteractionContext authenticate(AuthenticationRequest request, String code)     (2)
  void logout()     (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 InteractionContext if valid.

3 logout()

Invalidates this InteractionContext , 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 InteractionContext if valid.

logout()

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