-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix uninitialized user claim #1873
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
Fix uninitialized user claim #1873
Conversation
Some providers doesn't initialize data with setProviderDefaults function (keycloak-oidc for example), therefore UserClaim is never initialized with the default value and stay as an empty string. This result in an empty user.
if p.Scope == "" { | ||
p.Scope = defaults.scope | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not make sure every provider is using setProviderDefaults
? Does every provider definitely use buildSessionFromClaims
?
Moving it to buildSessionFromClaims
means the check is done on every authentication request rather than just in set up, so there's an efficiency hit too
Updated with
|
would like to add that we also ran into this issue recently w the generic oidc provider. reverted to 7.2.0 to fix it which was mentioned another issue here: it was broken starting at 7.2.1 (edited version. typo before) |
Just for the sake of testing live, could you test the v7.4.0-babs3 release on my fork before going back to 7.2.0 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @babs
Description
Some providers doesn't initialize data with
setProviderDefaults
function (keycloak-oidc for example), thereforeUserClaim
is never initialized with the default value (sub
) and stay an empty string. This leads to an empty user.Should close #1874
Checklist: