Package io.jmix.oidc.usermapper
Class BaseOidcUserMapper<T extends JmixOidcUser>
java.lang.Object
io.jmix.oidc.usermapper.BaseOidcUserMapper<T>
- Type Parameters:
T- class of Jmix user
- All Implemented Interfaces:
OidcUserMapper<T>
- Direct Known Subclasses:
DefaultOidcUserMapper,SynchronizingOidcUserMapper
public abstract class BaseOidcUserMapper<T extends JmixOidcUser>
extends Object
implements OidcUserMapper<T>
Abstract class implements the
OidcUserMapper and may be used for creating your own mappers.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringgetOidcUserUsername(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser) Extracts username from theoidcUserprotected abstract TinitJmixUser(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser) Method returns an instance of Jmix user, which may be either a new instance or an instance loaded from the user repository.protected voidperformAdditionalModifications(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser) Performs additional modifications of Jmix user instance.protected abstract voidpopulateUserAttributes(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser) Fills attributes ofjmixUserbased on information from theoidcUserprotected abstract voidpopulateUserAuthorities(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser) Fills authorities ofjmixUserbased on information from theoidcUsertoJmixUser(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser) Method returns an instance of Jmix user, which is enriched with additional data.
-
Constructor Details
-
BaseOidcUserMapper
public BaseOidcUserMapper()
-
-
Method Details
-
getOidcUserUsername
protected abstract String getOidcUserUsername(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser) Extracts username from theoidcUser- Returns:
- username
-
toJmixUser
Method returns an instance of Jmix user, which is enriched with additional data.- Specified by:
toJmixUserin interfaceOidcUserMapper<T extends JmixOidcUser>- Parameters:
oidcUser- OpenID user- Returns:
- Jmix user instance
-
initJmixUser
protected abstract T initJmixUser(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser) Method returns an instance of Jmix user, which may be either a new instance or an instance loaded from the user repository. Attributes and authorities will lately be filled in other methods. The responsibility of the current method is just to create or load an existing instance.- Parameters:
oidcUser- OpenID user- Returns:
- new Jmix user instance or Jmix user loaded from user repository
-
populateUserAttributes
protected abstract void populateUserAttributes(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser) Fills attributes ofjmixUserbased on information from theoidcUser- Parameters:
oidcUser-jmixUser-
-
populateUserAuthorities
protected abstract void populateUserAuthorities(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser) Fills authorities ofjmixUserbased on information from theoidcUser- Parameters:
oidcUser-jmixUser-
-
performAdditionalModifications
protected void performAdditionalModifications(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser) Performs additional modifications of Jmix user instance. Override this method in case you want to do some additional attribute values computations or if you want to do some operations with Jmix user instance, e.g. to store it in the database, like it is done in theSynchronizingOidcUserMapper- Parameters:
oidcUser-jmixUser-
-