DpopAuthProvider
class DpopAuthProvider(session: OAuthSession, signer: DpopSigner, sessionStore: OAuthSessionStore, refreshClient: HttpClient, json: Json = Json { ignoreUnknownKeys = true }) : AuthProvider
AuthProvider implementation that attaches DPoP proof-of-possession headers on every XRPC request and handles token refresh transparently.
On each request, produces:
Authorization: DPoP <access_token>DPoP: <signed-jwt-proof>(withath,htm,htu,nonce)
When the PDS responds with HTTP 401:
If
DPoP-Nonceheader is present → stores the nonce, retriesIf the access token is expired → refreshes via the token endpoint with the DPoP-bound refresh token, retries
If the refresh token is revoked → clears the session, throws OAuthSessionExpiredException
Refresh operations are serialized with a Mutex to prevent concurrent refreshes from invalidating the session.
Constructors
Link copied to clipboard
constructor(session: OAuthSession, signer: DpopSigner, sessionStore: OAuthSessionStore, refreshClient: HttpClient, json: Json = Json { ignoreUnknownKeys = true })