Class DefaultAuthenticator

java.lang.Object
org.apache.polaris.service.auth.DefaultAuthenticator
All Implemented Interfaces:
Authenticator<PrincipalAuthInfo,org.apache.polaris.core.auth.AuthenticatedPolarisPrincipal>

@RequestScoped @Identifier("default") public class DefaultAuthenticator extends Object implements Authenticator<PrincipalAuthInfo,org.apache.polaris.core.auth.AuthenticatedPolarisPrincipal>
The default authenticator that resolves a PrincipalAuthInfo to an AuthenticatedPolarisPrincipal.

This authenticator is used in both internal and external authentication scenarios.

  • Field Details

  • Constructor Details

    • DefaultAuthenticator

      public DefaultAuthenticator()
  • Method Details

    • authenticate

      public Optional<org.apache.polaris.core.auth.AuthenticatedPolarisPrincipal> authenticate(PrincipalAuthInfo credentials)
      Description copied from interface: Authenticator
      Authenticates the given credentials and returns an optional principal.

      If the credentials are not valid or if the authentication fails, implementations may choose to return an empty optional or throw an exception. Returning empty will generally translate into a NotAuthorizedException.

      Specified by:
      authenticate in interface Authenticator<PrincipalAuthInfo,org.apache.polaris.core.auth.AuthenticatedPolarisPrincipal>
      Parameters:
      credentials - the credentials to authenticate
      Returns:
      an optional principal if authentication is successful, or an empty optional if authentication fails.