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 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 prior 401 response (for example SASL-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

      <T> Optional<T> getStateObject(Class<T> clazz)
      Retrieve an implementation-controlled state object previously stored with setStateObject(Class, T). The slot is keyed by class; its lifetime equals one HTTP request's retry sequence. See AuthenticationCallContext.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

      <T> void setStateObject(Class<T> clazz, T value)
      Store a state object keyed by its (or any) class; a null value 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 class
      value - the state object, or null to remove the entry