Interface Authenticator

All Known Implementing Classes:
ApiKeyAuthenticator

public interface Authenticator
Strategy that resolves the Principal behind an incoming request from its credential.
  • Method Summary

    Modifier and Type
    Method
    Description
    authenticate(String method, String authorizationHeader)
    Resolves the principal for a request based on its method and credential.
  • Method Details

    • authenticate

      Optional<Principal> authenticate(String method, String authorizationHeader)
      Resolves the principal for a request based on its method and credential.

      The method is honored so reads stay open in the default deployment: a read returns the system principal when no credential is presented. A write with no configured authentication also returns the system principal (open mode). Otherwise a valid Bearer credential resolves to the principal it identifies, and an invalid or missing credential on a write returns empty (rejected). Authorization of the resolved principal against the requested action is the caller's responsibility.

      Parameters:
      method - the HTTP method
      authorizationHeader - value of the Authorization header, or null when absent
      Returns:
      the principal for an allowed request, or empty to reject