Interface HttpAuthChallengeHandler


public interface HttpAuthChallengeHandler
Capability: SASL-style multi-round challenge/response over HTTP (PIP-478).

Handles the existing Pulsar SASL-over-HTTP mechanism, where the server returns HTTP 401 carrying the challenge in Pulsar's custom SASL headers (for example SASL-Token / State / SASL-Server-ID) rather than the standard WWW-Authenticate header.

Standard WWW-Authenticate-based schemes (for example HTTP digest) are expected to be served by a separate sibling interface; the framework's HTTP auth driver dispatches to whichever a plugin implements.

  • Method Details

    • respondToHttpChallengeAsync

      CompletableFuture<HttpAuthHeaders> respondToHttpChallengeAsync(HttpAuthCallContext ctx)
      Compute the headers for the next round.

      The server's challenge headers from the prior 401 are available via HttpAuthCallContext.serverChallengeHeaders(); the returned HttpAuthHeaders are attached to the resubmitted request. Cross-round conversation state is kept in the context's state slot. Never throws synchronously: all failures are reported by completing the returned future exceptionally, never by throwing on the calling thread.

      Parameters:
      ctx - the per-call context (holds the server challenge and cross-round state)
      Returns:
      a future of the headers for the resubmitted request