Interface Authenticator
- All Known Implementing Classes:
ApiKeyAuthFilter,AuthFilter,AuthFilterChain,BearerTokenAuthFilter,OAuthFilter,OidcSessionAuthFilter,SamlAuthFilter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Lowest-level authentication contract shared by the servlet-filter layer (
AuthFilter,
AuthFilterChain) and the resource layer (RestAuthenticator).
Three-state return contract:
Optional.empty()— this authenticator does not apply (no recognizable credentials).Optional.of(AuthResult)— authentication succeeded.- throw
AuthenticationException— credentials were present but invalid.
See Also:
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionauthenticate(jakarta.servlet.http.HttpServletRequest req) Inspects the request and returns the authentication result.
-
Method Details
-
authenticate
Optional<AuthResult> authenticate(jakarta.servlet.http.HttpServletRequest req) throws AuthenticationException Inspects the request and returns the authentication result.- Parameters:
req- The incoming HTTP request. Nevernull .- Returns:
- The authentication result, or
Optional.empty()if this authenticator does not apply. - Throws:
AuthenticationException- If the request carries recognizable credentials that are invalid.
-