Package-level declarations

AtOAuth flow orchestrator, DpopAuthProvider, OAuthSession(Store), DpopSigner, and the exceptions thrown when a session expires or a step in the OAuth flow fails.

Types

Link copied to clipboard
class AtOAuth(clientMetadataUrl: String, sessionStore: OAuthSessionStore, httpClient: HttpClient, json: Json = Json { ignoreUnknownKeys = true })

AT Protocol OAuth 2.0 flow orchestrator for public clients.

Link copied to clipboard
data class AuthServerMetadata(val issuer: String, val authorizationEndpoint: String, val tokenEndpoint: String, val parEndpoint: String, val revocationEndpoint: String?, val pdsUrl: String, val did: String, val handle: String)

Resolved authorization server metadata — everything the OAuth flow needs to construct PAR requests, authorization URLs, and token exchange calls.

Link copied to clipboard
class DiscoveryChain(httpClient: HttpClient, json: Json = Json { ignoreUnknownKeys = true })

Implements the AT Protocol discovery chain:

Link copied to clipboard
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.

Link copied to clipboard

Signs DPoP proof JWTs using EC P-256 (ES256) per RFC 9449.

Link copied to clipboard
class OAuthDiscoveryException(message: String, cause: Throwable? = null) : RuntimeException
Link copied to clipboard
class OAuthException(message: String, cause: Throwable? = null) : RuntimeException
Link copied to clipboard
@Serializable
data class OAuthSession(val accessToken: String, val refreshToken: String, val did: String, val handle: String, val pdsUrl: String, val tokenEndpoint: String, val revocationEndpoint: String? = null, val clientId: String? = null, val dpopPrivateKey: ByteArray, val dpopPublicKey: ByteArray, val authServerNonce: String? = null, val clockOffsetSeconds: Long = 0, val pdsNonce: String? = null)

Persisted OAuth session state. Contains everything needed to make authenticated XRPC requests and refresh the session when the access token expires.

Link copied to clipboard
Link copied to clipboard

Platform-agnostic session persistence interface. Consumers provide the storage backend — the module handles serialization.