okta/okta-auth-js

Validate claims does not follow OpenID spec for audience validation

nholik opened this issue · 3 comments

nholik commented

Describe the bug

Per the openid spec:

aud
REQUIRED. Audience(s) that this ID Token is intended for. It MUST contain the OAuth 2.0 client_id of the Relying Party as an audience value. It MAY also contain identifiers for other audiences. In the general case, the aud value is an array of case-sensitive strings. In the common special case when there is one audience, the aud value MAY be a single case-sensitive string.

The library assumes the common special case only of one audience. It should allow there to be an array of audience claims as well and check that at least one matches.

Reproduction Steps?

Use the SDK with an issuer that sends back an array of audience claims in an id token. Validation will fail, even if there is a valid audience in the aud claim.

SDK Versions

7.5.0

Additional Information?

No response

nholik commented

I have submitted a PR with tests for this here: #1481

@nholik Thanks for reporting the issue and PR! We will have the PR reviewed and release the change once it's merged.

Internal Ref: OKTA-678622