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

Make UserManager.storeUser public

Open nzdjigit opened this issue 9 years ago • 4 comments

Hi,

We have an unusual scenario, so we're hoping someone could help us out.

We have an Angular 2 SPA app that gets authenticated against Azure AD. This returns to us an id_token, which we then use to hit our own API to generate an access_token with all the roles and expiration times in it. We call our API inside the signInRedirectCallback method after we acquire an id_token from Azure AD.

So far this flow works, the only thing we can't seem to be able to do is to update the current user details stored in the local storage with additional profile info and token expiration times. The oidc.user object in the local storage gets set just before it reaches the signInRedirectCallback method and we don't know how to override it with the new user object with additional details.

Could anyone please advise on how this could possibly be achieved?

Thanks

nzdjigit avatar Sep 12 '17 07:09 nzdjigit

That's not something that is supported, as it wasn't a use case that we designed for.

brockallen avatar Sep 12 '17 17:09 brockallen

Thanks Brock. That sure sucks!

Would it not be as simple as exposing the setUser function alongside the getUser function? That would solve this problem.

nzdjigit avatar Sep 13 '17 01:09 nzdjigit

Possibly. I could consider what's involved.

brockallen avatar Sep 13 '17 18:09 brockallen

I made it public, but use at your own risk (and then report back how it works for you) :)

brockallen avatar Sep 23 '17 21:09 brockallen