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

Attach extra token response claims as property on user object #1346

Open kherock opened 3 years ago

kherock commented 3 years ago

Hi, thanks for the amazing work on this library. I'm hoping this change can make it in quickly!

I'm using this library against a service implementing the SMART on FHIR OAuth extension. Upon signin, the token response has a few extra parameters that are passed to this library's User constructor, but they aren't stored anywhere. I've looked closely and there doesn't seem to be a good way to read these properties short of reimplementing most of UserManager. As such I've modified the constructor to store these additional fields as otherClaims.