atproto/oauth/metadata

atproto OAuth discovery: from a user’s PDS, find the authorization server and its endpoints. Two hops of well-known metadata: PDS /.well-known/oauth-protected-resource -> authorization_servers[] issuer /.well-known/oauth-authorization-server -> endpoints

Types

pub type AuthServerMetadata {
  AuthServerMetadata(
    issuer: String,
    authorization_endpoint: String,
    token_endpoint: String,
    pushed_authorization_request_endpoint: String,
    revocation_endpoint: option.Option(String),
  )
}

Constructors

  • AuthServerMetadata(
      issuer: String,
      authorization_endpoint: String,
      token_endpoint: String,
      pushed_authorization_request_endpoint: String,
      revocation_endpoint: option.Option(String),
    )

Values

pub fn discover(
  client: xrpc.Client,
  pds: String,
) -> Result(AuthServerMetadata, xrpc.XrpcError)

Resolve a PDS to its authorization server’s endpoints in one call.

pub fn fetch_authorization_server(
  client: xrpc.Client,
  issuer: String,
) -> Result(AuthServerMetadata, xrpc.XrpcError)
pub fn fetch_protected_resource(
  client: xrpc.Client,
  pds: String,
) -> Result(List(String), xrpc.XrpcError)
Search Document