Skip to content

[auth] Validate nonce claim in id_token after PKCE token exchange#278

Merged
partha-uber merged 2 commits into
mainfrom
sirker-nonce-pkce-validation
Jun 26, 2026
Merged

[auth] Validate nonce claim in id_token after PKCE token exchange#278
partha-uber merged 2 commits into
mainfrom
sirker-nonce-pkce-validation

Conversation

@partha-uber

@partha-uber partha-uber commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Stacked on #277.

Note: Once PR #279 (auto-nonce) merges, the if (sentNonce != null) guard here should be removed — nonce will always be present so validation should always run.

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

Test Plan

Revert Plan

Revert this commit. Nonce claim in id_token will no longer be validated.

@partha-uber partha-uber force-pushed the sirker-nonce-pkce-validation branch from a616fa6 to 2953c44 Compare June 26, 2026 18:11
partha-uber and others added 2 commits June 26, 2026 11:25
…s set)

Auto-nonce (#279) guarantees effectiveNonce is never null, so the
'if (sentNonce != null)' guard is no longer needed. Validation is now
unconditional — any PKCE response without an id_token nonce claim that
matches effectiveNonce is rejected.

Update existing PKCE tests to provide a matching id_token and add two
new tests covering the always-validated path.

Co-Authored-By: Claude <noreply@anthropic.com>
@partha-uber partha-uber force-pushed the sirker-nonce-pkce-validation branch from 2953c44 to 1aecbd3 Compare June 26, 2026 18:26
@partha-uber partha-uber changed the base branch from sirker-nonce-util to main June 26, 2026 18:26
@partha-uber partha-uber merged commit 19c2512 into main Jun 26, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants