Package org.apache.polaris.service.auth
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<org.apache.polaris.core.auth.AuthenticatedPolarisPrincipal> authenticate(PrincipalAuthInfo credentials) Authenticates the given credentials and returns an optional principal.
-
Field Details
-
PRINCIPAL_ROLE_ALL
- See Also:
-
PRINCIPAL_ROLE_PREFIX
- See Also:
-
-
Constructor Details
-
DefaultAuthenticator
public DefaultAuthenticator()
-
-
Method Details
-
authenticate
public Optional<org.apache.polaris.core.auth.AuthenticatedPolarisPrincipal> authenticate(PrincipalAuthInfo credentials) Description copied from interface:AuthenticatorAuthenticates 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:
authenticatein interfaceAuthenticator<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.
-