-
Notifications
You must be signed in to change notification settings - Fork 209
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
refresh userinfo data on demand #877
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #877 +/- ##
==========================================
+ Coverage 77.69% 78.11% +0.42%
==========================================
Files 44 45 +1
Lines 1690 1723 +33
Branches 331 338 +7
==========================================
+ Hits 1313 1346 +33
- Misses 340 341 +1
+ Partials 37 36 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Thanks for providing this. I like the claims parts, yes it makes it easier when we split it in its own service. This code is almost ready to merge. With the Idea:
Simple without edge cases:
|
Would be nice if you could split this up into two merge requests. |
What you added as an example was exactly my first implementation. After that, my reasoning was: UserManager is described as I can definitely simplify this. What do you think should happen if the token expired? We should throw an exception?
Yeah no problem, you mean one for "splitting the claims service and changing the merge behavior" and the other for "adding the userinfo refresh behavior" ? |
@marcoreni Curious if your still working on this? I've got a use case for this functionality and would love to be able to use it. |
Same here |
Hi all, sadly, we did not have time to wait on the discussion on #881, so we forked the library and implemented a basic version of the "on demand update" (that served our purposes). The implementation is available on these two commits but I think it's not ready for merge for the following reasons: I don't think I'll have time to tackle this again soon. |
Fixes #846 #852
Checklist
This PR adds a new parameter "refreshUserInfo" to "loadUser", so that it's possible to refresh (and store) updated userinfo claims for the logged user.
loadUser
will refresh the token, if expired, otherwise it will simply reload userinfo.In order for this to be enabled,
loadUserInfo
should be enabled in the settings.NOTE: if the token is refreshed during the procedure, old claims that "disappeared" will be removed. Otherwise, they will be kept.
It also:
true
for backwards compatibility) that, if disabled, overwrites claims instead of transforming types.getUserInfo
method in OidcClient to perform the raw userinfo data retrieval.LMKWYT