atproto_core/oauth/metadata

atproto OAuth discovery as Effects, 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(
  pds: String,
) -> effect.Effect(Result(AuthServerMetadata, xrpc.XrpcError))

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

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