authts / oidc-client-ts

OpenID Connect (OIDC) and OAuth2 protocol support for browser-based JavaScript applications
https://authts.github.io/oidc-client-ts/
Apache License 2.0
1.32k stars 195 forks source link

UserProfile in session/local storage #1507

Open johnfabian opened 3 months ago

johnfabian commented 3 months ago

How can I either hide the UserProfile in storage since it is displaying in plain text and I have role claims in the idToken and I don't want the idtoken claims in the UserProfile. I've used other oidc clients for other technologies and that was never displayed like that. Is there a way to turn that off?

loadUserInfo: false, filterProtocolClaims: true, response_type: 'id_token token'

pamapa commented 3 months ago

Using the settings userStore gives you full control. See https://authts.github.io/oidc-client-ts/interfaces/UserManagerSettings.html#userStore

johnfabian commented 3 months ago

I am but the code has export type UserProfile = IdTokenClaims; so the idtokenclaims and being added to the profile regardless and the filterProtocolClaims:true doesn't do anything so I'm just creating a custom Storage and filtering out profile. profile shouldn't display all those properties by default and should be optional to even store Profile in storage