IdentityModel / oidc-client-js

OpenID Connect (OIDC) and OAuth2 protocol support for browser-based JavaScript applications
Apache License 2.0
2.43k stars 842 forks source link

Claims with uri as a key returned as array #1377

Open maximegel opened 3 years ago

maximegel commented 3 years ago

Current behavior

Our ID token contains claims with uri as a key and an object as the value:

image

For some reason, oidc-client store and return these claims as an array with duplicates:

image

In the image above, elements at index 0 and 1 are structurally the same.

Expected behavior

Claims should be stored and returned exacly the same as they are in the token.

Environment

"oidc-client": "1.11.5"

brockallen commented 3 years ago

Claims should be stored and returned exacly the same as they are in the token.

But when merging claims from the userinfo endpoint they have to get put in there somehow.

maximegel commented 3 years ago

@brockallen Thats why I have duplicates? One coming from the ID token and one coming from the userinfo endpoint? It kind of make sense but its not very intuitive. Would it be possible to merge identical claims and return them as an object?

brockallen commented 3 years ago

Thats why I have duplicates? One coming from the ID token and one coming from the userinfo endpoint?

I don't know, but it's possible.