Package dev.dokimos.server.filter
Interface Authenticator
- All Known Implementing Classes:
ApiKeyAuthenticator
public interface Authenticator
Strategy that resolves the
Principal behind an incoming request from its credential.-
Method Summary
Modifier and TypeMethodDescriptionauthenticate(String method, String authorizationHeader) Resolves the principal for a request based on its method and credential.
-
Method Details
-
authenticate
Resolves the principal for a request based on its method and credential.The method is honored so reads stay open in the default deployment: a read returns the system principal when no credential is presented. A write with no configured authentication also returns the system principal (open mode). Otherwise a valid
Bearercredential resolves to the principal it identifies, and an invalid or missing credential on a write returns empty (rejected). Authorization of the resolved principal against the requested action is the caller's responsibility.- Parameters:
method- the HTTP methodauthorizationHeader- value of theAuthorizationheader, ornullwhen absent- Returns:
- the principal for an allowed request, or empty to reject
-