Header menu logo FSharp.ATProto

OAuthBridge Module

Bridges OAuth sessions with AtpAgent, enabling all convenience functions to work with DPoP-authenticated OAuth sessions.

Functions and values

Function or value Description

getSessionDid session

Full Usage: getSessionDid session

Parameters:
Returns: Did

Get the DID of the currently authenticated OAuth user.

session : OAuthSession
Returns: Did

isExpired session

Full Usage: isExpired session

Parameters:
Returns: bool

Check whether the OAuth session's access token has expired.

session : OAuthSession
Returns: bool

resumeSession clientMetadata session onSessionUpdate agent

Full Usage: resumeSession clientMetadata session onSessionUpdate agent

Parameters:
Returns: AtpAgent

Resume an OAuth-authenticated session on an AtpAgent. Returns a new agent configured with DPoP authentication and OAuth token refresh. All XRPC requests through the returned agent will use DPoP-bound access tokens. The optional onSessionUpdate callback is called with the new OAuthSession whenever the token is refreshed, allowing consumers to persist the session to disk or database.

clientMetadata : ClientMetadata
session : OAuthSession
onSessionUpdate : (OAuthSession -> unit) option
agent : AtpAgent
Returns: AtpAgent

Type something to start searching.