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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<P>
authenticate(C credentials)
Given a set of user-provided credentials, return an optional principal.
-
-
-
Method Detail
-
authenticate
Optional<P> authenticate(C credentials) throws AuthenticationException
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
-
-