PKCE (always) + id_token nonce validation + public-client no-secret #41

Merged
ginjiruu merged 2 commits from t36-pkce-nonce into t34-oidc-trio 2026-09-16 00:51:21 +00:00
Owner

Closes #36

Make the OIDC Flow always use PKCE (both Public and Confidential clients), validate the id_token nonce against the State blob's nonce, and make Public clients send no client_secret on the code-exchange and refresh grants (Confidential clients still send it).

  • PKCE via x/oauth2 (GenerateVerifier / S256ChallengeOption / VerifierOption); the State blob carries the pkce_verifier.
  • The callback verifies the exchanged id_token (go-oidc) and 403s on a nonce mismatch or verification failure (fail-closed, no Session).
  • Public clients set Config.ClientSecret=""; x/oauth2 omits an empty client_secret from the form entirely (verified, not just empty).
  • Includes code-review fixes: DRY clientSecretOf/sessionTTL helpers and a log-style cleanup.

Stacked on #34 (which stacks on #33 and #32). Part of the public-client + trio effort (spec #31).

Closes #36 Make the OIDC Flow **always use PKCE** (both Public and Confidential clients), validate the id_token **nonce** against the State blob's nonce, and make **Public clients send no `client_secret`** on the code-exchange and refresh grants (Confidential clients still send it). - PKCE via x/oauth2 (`GenerateVerifier` / `S256ChallengeOption` / `VerifierOption`); the State blob carries the `pkce_verifier`. - The callback verifies the exchanged id_token (go-oidc) and 403s on a nonce mismatch or verification failure (fail-closed, no Session). - Public clients set `Config.ClientSecret=""`; x/oauth2 omits an empty `client_secret` from the form entirely (verified, not just empty). - Includes code-review fixes: DRY `clientSecretOf`/`sessionTTL` helpers and a log-style cleanup. Stacked on #34 (which stacks on #33 and #32). Part of the public-client + trio effort (spec #31).
refactor: address code-review feedback (DRY clientSecretOf/sessionTTL, log style)
Some checks failed
Lint / Run on Ubuntu (push) Has been cancelled
E2E Tests / Run on Ubuntu (push) Has been cancelled
Tests / Run on Ubuntu (push) Has been cancelled
Lint / Run on Ubuntu (pull_request) Has been cancelled
E2E Tests / Run on Ubuntu (pull_request) Has been cancelled
Tests / Run on Ubuntu (pull_request) Has been cancelled
6ee199bf5d
ginjiruu merged commit 450037d75d into t34-oidc-trio 2026-09-16 00:51:21 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lab/authz-bridge!41
No description provided.