- 
                Notifications
    
You must be signed in to change notification settings  - Fork 118
 
Description
Let's deprecate and remove USERS.USER_TYPE.
The value is currently used as a key for UserInfoProvider when retrieving UserInfo.
The original idea was to retrieve UserInfo using the provider determined on the user's first login, i.e. when the USERS record is created. Reasoning being that we needed UserInfo not only for the current user, but also for users that might not be currently logged in so we better save the original provider with the user entry.
Unfortunately, this scheme doesn't work for users that log in using multiple providers, e.g. same user logging in using LDAP today and OIDC tomorrow. There are already some situations when we swap USER_TYPES dynamically to match the current user's current realm.
I propose:
- deprecate Java enum 
UserTypeand all its uses (drop/null the column eventually) - remove 
UserInfoProvider#create- user creation should be handled byUserManager, not by extension points - retrieve UserInfoProviders by using the current user's 
UserPrincipal#getRealmvalue and the only place where we should use UserInfoProviders directly are:UserManager, when creating new user entries- when fetching UserInfo for the current user
 
 - all other places where we need UserInfo we should fetch it from the DB
 - provider-specific stuff like UserLdapGroupSynchronizer can still use "their own" UserInfoProviders freely whenever needed
 
Am I missing anything? Are there any other uses for USERS.USER_TYPE (besides being a confusing equivalent of UserPrincipal#getRealm)?