Skip to content

Accept array form for aud claim per RFC 7519 §4.1.3 - #280

Open
RicardoKoch wants to merge 1 commit into
okta:masterfrom
RicardoKoch:upstream-pr/array-aud-validation
Open

Accept array form for aud claim per RFC 7519 §4.1.3#280
RicardoKoch wants to merge 1 commit into
okta:masterfrom
RicardoKoch:upstream-pr/array-aud-validation

Conversation

@RicardoKoch

@RicardoKoch RicardoKoch commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

DefaultIDTokenValidator currently performs a strict scalar comparison against clientId. RFC 7519 §4.1.3 and OIDC Core 1.0 §3.1.3.7 both permit aud to be a JSON array of strings; tokens emitted in that form are silently rejected today.

Extend the .audience check to:

  • When aud is a JSON array, require clientId to be a member.
  • Otherwise, fall back to the existing scalar comparison.

Adds two regression tests (testAudienceArrayContainingClientIdSucceeds, testAudienceArrayNotContainingClientIdFails) following the existing test-fixture conventions.

Closes #281

DefaultIDTokenValidator currently performs a strict scalar comparison
against `clientId`. RFC 7519 §4.1.3 and OIDC Core 1.0 §3.1.3.7 both
permit `aud` to be a JSON array of strings; tokens emitted in that form
are silently rejected today.

Extend the `.audience` check to:

  - When `aud` is a JSON array, require `clientId` to be a member.
  - Otherwise, fall back to the existing scalar comparison.

Adds two regression tests (`testAudienceArrayContainingClientIdSucceeds`,
`testAudienceArrayNotContainingClientIdFails`) following the existing
test-fixture conventions.
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.

DefaultIDTokenValidator rejects array form of aud claim (RFC 7519 §4.1.3)

2 participants