Skip to content

fix: support space-separated OIDC prompt parameter values#4083

Open
raajheshkannaa wants to merge 1 commit intoory:masterfrom
raajheshkannaa:feat/fix-oidc-prompt-parsing
Open

fix: support space-separated OIDC prompt parameter values#4083
raajheshkannaa wants to merge 1 commit intoory:masterfrom
raajheshkannaa:feat/fix-oidc-prompt-parsing

Conversation

@raajheshkannaa
Copy link

Fixes #4039

  • The OIDC spec (Section 3.1.2.1) defines prompt as a space-separated list of values
  • The existing code compared the entire string against individual values, rejecting valid multi-value inputs like select_account consent
  • Split the prompt string by spaces and use slices.Contains to check for each recognized value
  • Adds test cases for multi-value prompt combinations

The OIDC spec allows multiple prompt values separated by spaces
(e.g. "select_account consent"). The validator already handled this
correctly by splitting on spaces, but GenerateIDToken in strategy_jwt.go
used a switch statement on the raw unsplit string, causing prompt
values like "login consent" to skip login-specific validation.

Split the prompt parameter by space in GenerateIDToken and use
slices.Contains to check for individual values, consistent with
how the validator and consent strategy already handle it.

Fixes ory#4039
@raajheshkannaa raajheshkannaa requested review from a team and aeneasr as code owners March 18, 2026 03:32
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.

Unknown value '[select_account consent]' for prompt parameter

1 participant