Latch.Discovery (latch v0.1.0)

Copy Markdown

Discovers the authorization server for a PDS and validates the binding between them, per the atproto OAuth profile.

The PDS publishes /.well-known/oauth-protected-resource naming its authorization server, that server's metadata issuer must in turn match the URL it was discovered at. Both directions are checked before the metadata is trusted.

Summary

Functions

Resolves a PDS endpoint to its authorization server metadata.

Functions

discover(pds_endpoint)

@spec discover(String.t()) ::
  {:ok, Latch.ServerMetadata.t()}
  | {:error, Latch.Error.Discovery.t() | Latch.Error.Transport.t()}

Resolves a PDS endpoint to its authorization server metadata.