DiscoveryChain
Implements the AT Protocol discovery chain:
Handle → DID: HTTP fallback via
/.well-known/atproto-didon the handle's domain. (DNS_atproto.<handle>TXT is preferred but requires a DNS library; HTTP fallback covers all cases.)DID → PDS: Fetch the DID document from
plc.directory(fordid:plc) or the DID method's resolution endpoint, extract the#atproto_pdsservice endpoint.PDS → Auth Server: Fetch
/.well-known/oauth-protected-resource→authorization_servers[0], then/.well-known/oauth-authorization-server→ extract all OAuth endpoint URLs.Bidirectional handle verification: verify the DID document's
alsoKnownAsfield claims the original handle.
Constructors
Functions
Resolves a handle or DID all the way to a fully-populated AuthServerMetadata ready for the OAuth flow.