-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get additional AccessToken Response properties from SigninResponse to User object, or make user object extensible. #1485
Comments
@pamapa do you have any thoughts? |
You can control the claims remaining in the user with the |
Hi @pamapa , I believe I'm having the same issue as the OP but with Keycloak, it bundles the allowed roles for user into access_token and the only claims I'm seeing in user.profile are the ones from id_token. I.e. setting
|
Thing is, from the OpenID Connect (OIDC) specification:
The User object is an aggregation of what's inside the ID token + what's returned from the UserInfo Endpoint. But Access tokens on the contrary, are open to implementation (i.e. they can be anything). Therefore, the best thing to do is to read the info you need directly from the access_token. |
I'm dealing with an OIDC situation where the access token response contains more useful properties that I need than get exposed by the User object. EPIC OAUTH implementation. For example their token response includes a patient property that would be very useful if it could be stored in the User object. UserManagerSettings seems to allow for a lot of overrides, but not which properties should be retained from the SigninResponse for the User object.
I know that they exist in the SigninResponse object, but the constructor of the user object filters that to the known properties. I like working with the events that come off the UserManager, it makes working your library easy. If I'm missing something please tell me, but I feel like we should have a setting to extend the User object.
I would be happy to work on that if interested.
The text was updated successfully, but these errors were encountered: