Interface HttpAuthCallContext
public interface HttpAuthCallContext
The per-call context for HTTP authentication (PIP-478).
Carries the request URI, a per-exchange state slot (with the same contract as on
AuthenticationCallContext), and — for SASL-style challenge/response — the server's challenge
headers from the prior 401 response.
-
Method Summary
Modifier and TypeMethodDescription<T> Optional<T> getStateObject(Class<T> clazz) Retrieve an implementation-controlled state object previously stored withsetStateObject(Class, T).For SASL-style HTTP challenge/response: the challenge headers from the server's prior401response (for exampleSASL-Token/State/SASL-Server-ID).<T> voidsetStateObject(Class<T> clazz, T value) Store a state object keyed by its (or any) class; anullvalue removes the entry.
-
Method Details
-
requestUri
URI requestUri()- Returns:
- the URI of the request being authenticated
-
serverChallengeHeaders
Optional<HttpAuthHeaders> serverChallengeHeaders()For SASL-style HTTP challenge/response: the challenge headers from the server's prior401response (for exampleSASL-Token/State/SASL-Server-ID). Empty on the first request, before any challenge.- Returns:
- the server's challenge headers, if a challenge has been received
-
getStateObject
Retrieve an implementation-controlled state object previously stored withsetStateObject(Class, T). The slot is keyed by class; its lifetime equals one HTTP request's retry sequence. SeeAuthenticationCallContext.getStateObject(Class)for the full contract.- Type Parameters:
T- the state object type- Parameters:
clazz- the state object's key class- Returns:
- the stored object, if present
-
setStateObject
Store a state object keyed by its (or any) class; anullvalue removes the entry. Rounds of one exchange are serialized by the framework, so slot access within an exchange needs no synchronization.- Type Parameters:
T- the state object type- Parameters:
clazz- the key classvalue- the state object, ornullto remove the entry
-