Interface Authenticator
-
- All Superinterfaces:
Plugin
public interface Authenticator extends Plugin
AnAuthenticator's job is to authenticate an inbound request by resolving the providedAuthenticationRequestto an instance ofAuthentication, which includes an authenticatedActorwithin. In the case thatAuthenticationcannot be resolved, for example because the request is missing the required authentication information, anAuthenticationExceptionmay be thrown.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Authenticationauthenticate(AuthenticationRequest authenticationRequest)Authenticates an inbound request given an instance of theAuthenticationRequest.voidinit(java.util.Map<java.lang.String,java.lang.Object> authenticatorConfig, AuthenticatorContext context)Initialize the Authenticator.
-
-
-
Method Detail
-
init
void init(@Nonnull java.util.Map<java.lang.String,java.lang.Object> authenticatorConfig, @Nullable AuthenticatorContext context)Initialize the Authenticator. Invoked once at boot time.- Parameters:
authenticatorConfig- config provided to the authenticator derived from the Metadata Service YAML config. This config comes from the "plugins[].params.configs" configuration.context- nullable configuration objects that are potentially required by an Authenticator instance.
-
authenticate
@Nullable Authentication authenticate(@Nonnull AuthenticationRequest authenticationRequest) throws AuthenticationException
Authenticates an inbound request given an instance of theAuthenticationRequest.- Parameters:
authenticationRequest- authentication requestAuthenticationRequestthat need to be authenticated If the request is authenticated successfully, an instance ofAuthenticationis returned. If the request cannot be authenticated, returns "null" or throws anAuthenticationException.- Throws:
AuthenticationException
-
-