oidc-client-js icon indicating copy to clipboard operation
oidc-client-js copied to clipboard

Is there a way to add additional metadata to the user object?

Open VictorioBerra opened this issue 4 years ago • 6 comments

After I load the user, I go to PolicyServer and gather its policies. I want to store this locally along with my tokens and all that and get it from the user manager.

Is there a way to do this?

VictorioBerra avatar Jul 16 '19 20:07 VictorioBerra

Not really. You'd have to gather them at IS and put those as claims in the id_token or profile.

brockallen avatar Aug 06 '19 17:08 brockallen

@brockallen Can we label this as enhancement?

Feature request:

  • updateUser() - Allow tapping into the storage pipeline to add additional metatdata to a user, like PolicyServer data, or anything else. Similar to using state in authorize params.

VictorioBerra avatar Aug 06 '19 17:08 VictorioBerra

Perhaps a callback to modify the user?

brockallen avatar Aug 15 '19 12:08 brockallen

Sounds good to me, off which method? I would say signinRedirectCallback but you need the user most of the time before you can do anything.

VictorioBerra avatar Aug 15 '19 13:08 VictorioBerra

Don't know and I don't foresee having the time to look into this anytime soon (I just released 1.9.0 this morning).

brockallen avatar Aug 15 '19 16:08 brockallen

Well, if we figure out where we want it I might have the bandwidth to do it. And if I cant get to it right away the community will see the design here and someone may knock it out.

VictorioBerra avatar Aug 15 '19 16:08 VictorioBerra