Expand description
Authorization-server discovery, and the validations that make it safe.
The chain is: PDS → /.well-known/oauth-protected-resource → issuer →
/.well-known/oauth-authorization-server → endpoints.
Every link is attacker-influenced. The PDS comes from a DID document that a
did:web host or plc.directory served; the issuer comes from the PDS. So
each document must prove it is talking about itself:
- the protected-resource document’s
resourcemust equal the PDS origin, - it must name exactly ONE authorization server,
- the authorization-server document’s
issuermust equal the URL it was fetched from — the mix-up defence, and the reason these documents must not be fetched through a redirect, - and if the AS lists
protected_resources, the PDS must appear in it.
The last one closes the loop in the other direction: without it a PDS can unilaterally name an authorization server that has never heard of it.
Structs§
- Authorization
Server - The endpoints a validated authorization server offers.
Functions§
- authorization_
server_ url - Where an issuer’s authorization-server metadata lives.
- discover
- Resolve a PDS to its authorization server, both fetches and both validations.
- discover_
with discoverwith the fetch injected.- origin_
of - The origin of a URL: scheme + host + non-default port, and nothing else.
- protected_
resource_ url - Where a PDS’s protected-resource document lives.
- resolve_
documents - Validate an already-fetched pair of discovery documents.
- validate_
authorization_ server - Validate
/.well-known/oauth-authorization-serverand return its endpoints. - validate_
issuer_ form - An issuer identifier must be canonical before it can be compared.
- validate_
protected_ resource - Validate
/.well-known/oauth-protected-resourceand return its issuer.