Expand description
Pushed Authorization Requests (RFC 9126).
POST /oauth/par lets the client push the authorization request parameters
out-of-band, then navigate the browser to /oauth/authorize?request_uri=...
with a short, opaque reference. Required by atproto OAuth; also avoids URL
length and referer-leakage problems with long inline parameters.
Flow:
- Client POSTs the same parameters it would pass to GET /oauth/authorize.
- Server validates them up front (same checks the GET handler does: response_type, PKCE method, client metadata resolution, redirect_uri).
- On success, the server generates a URN of the form
urn:ietf:params:oauth:request_uri:<random-id>(RFC 9126 §2.2, RFC-standard form used by atproto OAuth clients) and stores the validatedAuthorizeParamssnapshot keyed by it. 60s TTL. - Returns
{ "request_uri": "...", "expires_in": 60 }with HTTP 201.
The /oauth/authorize GET handler resolves request_uri by consuming the
entry (single-use per spec) and proceeding as if the params had been inline.
Structs§
- ParForm
- PAR form body. Same shape as
AuthorizeParams, but accepted as a form POST. - ParResponse
- PAR success response body (RFC 9126 §2.2).
Constants§
- PAR_
TTL_ SECS - PAR request lifetime. RFC 9126 recommends short-lived (e.g. <= 60s).
Functions§
- push_
authorization_ request - POST /oauth/par