DpopAuthProvider
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 (
error=invalid_grant) → clears the session, throws OAuthSessionExpiredExceptionOtherwise (network error, 5xx/429, unparseable/captive-portal body, or any non-
invalid_granterror) → throws the retryable OAuthRefreshFailedException and LEAVES THE SESSION INTACT, so a flaky connection can't sign the user out
Refresh operations are serialized with a Mutex to prevent concurrent refreshes from invalidating the session.