Header menu logo FSharp.ATProto

ClientDiscovery Module

Client metadata discovery, PKCE validation, and client assertion validation.

Types

Type Description

ClientCache

A simple cache for client metadata with configurable TTL.

Functions and values

Function or value Description

fetchClientMetadata httpClient clientId

Full Usage: fetchClientMetadata httpClient clientId

Parameters:
Returns: Task<Result<ClientMetadata, OAuthServerError>>

Fetch client metadata from the client_id URL. Loopback clients return default metadata without an HTTP fetch. Non-loopback clients must use HTTPS.

httpClient : HttpClient
clientId : string
Returns: Task<Result<ClientMetadata, OAuthServerError>>

isLoopbackClient clientId

Full Usage: isLoopbackClient clientId

Parameters:
    clientId : string

Returns: bool

Check if a client_id URL is a loopback client (http://localhost or http://127.0.0.1). Loopback clients get special treatment per the AT Protocol OAuth spec.

clientId : string
Returns: bool

validateClientAssertion assertionType assertion _expectedClientId

Full Usage: validateClientAssertion assertionType assertion _expectedClientId

Parameters:
    assertionType : string
    assertion : string
    _expectedClientId : string

Returns: Result<unit, OAuthServerError>

Validate a client assertion for confidential clients. Checks that the assertion type is correct and the assertion is non-empty. Full JWT validation is a stretch goal.

assertionType : string
assertion : string
_expectedClientId : string
Returns: Result<unit, OAuthServerError>

validateClientMetadata metadata

Full Usage: validateClientMetadata metadata

Parameters:
Returns: Result<unit, OAuthServerError>

Validate that client metadata meets AT Protocol OAuth requirements.

metadata : ClientMetadata
Returns: Result<unit, OAuthServerError>

validatePkceS256 verifier challenge

Full Usage: validatePkceS256 verifier challenge

Parameters:
    verifier : string
    challenge : string

Returns: bool

Verify an S256 PKCE code challenge against the given verifier. Hashes the verifier with SHA-256, base64url encodes it, and compares with the challenge.

verifier : string
challenge : string
Returns: bool

Type something to start searching.