Package io.dropwizard.auth
Interface Authenticator<C,P extends Principal>
- Type Parameters:
C
- the type of credentials the authenticator can authenticateP
- the type of principals the authenticator returns
- All Known Implementing Classes:
CachingAuthenticator
public interface Authenticator<C,P extends Principal>
An interface for classes which authenticate user-provided credentials and return principal
objects.
-
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(C credentials) Given a set of user-provided credentials, return an optional principal.
-
Method Details
-
authenticate
Given a set of user-provided credentials, return an optional principal. If the credentials are valid and map to a principal, returns anOptional.of(Object)
. If the credentials are invalid, returns anOptional.empty()
.- Parameters:
credentials
- a set of user-provided credentials- Returns:
- either an authenticated principal or an absent optional
- Throws:
AuthenticationException
- if the credentials cannot be authenticated due to an underlying error
-