AuthProvider
Supplies authentication headers for XRPC requests. Attached at client construction or per-call via XrpcClient.query / XrpcClient.procedure overrides.
The method receives the HTTP method and target url so that proof-of-possession schemes like DPoP can bind the proof to the specific request.
Return an empty map for unauthenticated requests.
Migration from bearerToken()
This interface was widened from bearerToken(): String? to authHeaders(method, url): Map<String, String> to support DPoP (which needs both Authorization: DPoP <token> and DPoP: <proof>). Existing consumers should migrate:
// Before
val auth = BearerTokenAuth("my-token")
// After — same class, same constructor, new internals
val auth = BearerTokenAuth("my-token")BearerTokenAuth and NoAuth are updated in-place; custom impls need to implement authHeaders instead of bearerToken.
Inheritors
Functions
Called by XrpcClient when a request returns HTTP 401. The provider can inspect the response headers (e.g. DPoP-Nonce) and update its internal state for a retry.