Interface Authenticator

All Superinterfaces:
Plugin

public interface Authenticator extends Plugin
An Authenticator's job is to authenticate an inbound request by resolving the provided AuthenticationRequest to an instance of Authentication, which includes an authenticated Actor within.

In the case that Authentication cannot be resolved, for example because the request is missing the required authentication information, an AuthenticationException may be thrown.

  • Method Details

    • init

      void init(@Nonnull Map<String,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 the AuthenticationRequest.
      Parameters:
      authenticationRequest - authentication request AuthenticationRequest that need to be authenticated If the request is authenticated successfully, an instance of Authentication is returned. If the request cannot be authenticated, returns "null" or throws an AuthenticationException.
      Throws:
      AuthenticationException