- Direct Known Subclasses:
public abstract class Authenticator extends Object
Authenticator represents an implementation of an HTTP authentication mechanism. Sub-classes provide implementations of specific mechanisms such as Digest or Basic auth. Instances are invoked to provide verification of the authentication information provided in all incoming requests. Note. This implies that any caching of credentials or other authentication information must be done outside of this class.
Nested Class SummaryModifier and TypeClassDescription
static classIndicates an authentication failure.
static classBase class for return type from
static classIndicates an authentication must be retried.
static classIndicates an authentication has succeeded and the authenticated user principal can be acquired by calling
protectedConstructor for subclasses to call.
Method SummaryModifier and TypeMethodDescription
(HttpExchange exch)Called to authenticate each incoming request.
Authenticatorprotected Authenticator()Constructor for subclasses to call.
authenticatepublic abstract Authenticator.Result authenticate
(HttpExchange exch)Called to authenticate each incoming request. The implementation must return a
Authenticator.Retryobject as appropriate:
Failuremeans the authentication has completed, but has failed due to invalid credentials.
Successmeans that the authentication has succeeded, and a
Principalobject representing the user can be retrieved by calling
Retrymeans that another HTTP exchange is required. Any response headers needing to be sent back to the client are set in the given
HttpExchange. The response code to be returned must be provided in the
Retrymay occur multiple times.
HttpExchangeupon which authenticate is called
- the result