~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

OAuth: a PAR with no DPoP proof taken, as the reference takes it

Open
Open chadtmiller.com wants to merge into main from chadtmiller.com/monolith:oauth/par-without-dpop

trezy.pet couldn't sign in with an account on Monolith: its PAR carries no DPoP proof, which Bluesky's PDS takes and Monolith refused 401 invalid_dpop_proof. This takes such a PAR, as the reference does, and marks it in the spec as a departure from atproto/oauth.md that we may drop once clients send proofs at PAR.

Claude Opus 5.5 · high

What changes

Spec (spec/OAUTH.md):

  • PAR step 4: a request with no DPoP header is taken, its key bound at the token request. The Note under it says this departs from atproto/oauth.md, that refusing it is the stricter and right answer, and that it is a candidate to drop.
  • Step 6: dpop_jkt given without a proof is kept as the request's key.
  • What is kept: no key for a request with neither a proof nor dpop_jkt.
  • The code grant's step 2: a keyless request takes the token request's proof's key, and the session is bound to it.
  • "Where the reference departs from the specs": the first row now says the server takes it too, compared, and a candidate to drop.

Harness (harness/checks/oauth.mjs):

  • newRequest sometimes PARs with no proof, with or without dpop_jkt, as form or JSON. The whole sign-in after it is compared with the reference.
  • The server-alone check that held such a PAR to 401 is removed from oauthDepartures.

pds-server (oauth.rs), built by a fresh agent given AGENTS.md's step 3 rules and the spec alone:

  • A request's DPoP key is optional.
  • PAR without a proof runs the same checks in the same order, and keeps no key, or dpop_jkt.
  • The code grant binds a keyless request to the token request's proof's key. A keyed one must still match it.
  • Comments there carry the spec's warning.
  • Unit tests:
    • par_checks_in_order runs every refusal again without a proof.
    • New a_request_with_no_key_takes_the_token_requests covers binding, refresh with the bound key, a second key refused and ending the session, and dpop_jkt without a proof held to its key.

Why

From the production log on 2026-11-22: two sign-ins from trezy.pet reached /oauth/par and were answered 401 in under a millisecond, with nothing fetched of the client. A PAR with no proof gets exactly that answer. trezy.pet's client, written against Bluesky's PDS, sends its first proof at the token request.

How it was checked

  • Against main: --only oauthLogin fails at the first PAR without a proof. The reference answers 201; the server, 401.
  • With the change: --only oauthLogin,oauthParRefused,oauthDpopRefused,oauthTokenRefused,oauthDepartures, 80 steps, seeds 1–3, all agree.
  • Cargo: cargo test -p pds-server --lib -- oauth (83 tests) passes, as the server agent reported. Clippy and fmt are clean.
  • Gates: just quick runs here; the full gates are the gates workflow.

Shortcomings

  • It loosens what the spec asks of clients, on purpose and marked. Dropping it later is a revert of PAR step 4's first sentence, the Note, the table row and the harness draw.
  • Not confirmed against trezy.pet itself: its PAR headers are not logged anywhere I could read. Once deployed, a sign-in will say.
  • An empty dpop_jkt without a proof is kept as a key no proof matches, so that sign-in ends at the code grant with invalid_grant. The reference's answer to that is not compared.
Approved an earlier version

This takes a PAR with no DPoP proof, as the reference does. The request's key becomes optional, and the code grant binds a keyless request to the token request's proof key. A request that has a key must still match it. I found nothing that must change.

  • Spec: it is updated in PAR step 4, step 6, "What is kept", the code grant's step 2, the departures table and the harness description. The Note marks the change as a departure from atproto/oauth.md.
  • Code: exchange copies the token request's jkt into the session, and a stored request with no key accepts any proof key there. The MCP issuer's empty key still has to match, as before. settle is skipped when there is no proof, so no proof's jti is recorded.
  • Harness: the draw only adds a case compared against the reference. The only check removed is the server-alone one that held such a PAR to 401, which is no longer the intended behaviour.
  • Changeset: it is present and written for the people who run the server or call it.
  • Not run: I did not run the tests or read the check results.

One small point, which does not block this: an empty dpop_jkt with no proof is kept as Some(""), so that sign-in ends at the code grant with invalid_grant. The pull body already says the reference's answer to that is not compared.

chadtmiller.com added 1 commit
Approved

Carried forward: the change this pull makes at d4125e09c5ac336890a3fc45c5b57b536701baf2 is the one reviewed at a8f3c9c35ace1ca8dd1d94bfd5662af83dcf77c7, so that review stands. What is new comes from its base.

Approved

1 approval

In a batch of its own being checked

It lands any minute now, once its batch passes its checks.

Some checks are still running

1 running, 2 passed, 1 skipped