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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.protected void
performAdditionalModifications
(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser) Performs additional modifications of Jmix user instance.protected abstract void
populateUserAttributes
(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser) Fills attributes ofjmixUser
based on information from theoidcUser
protected abstract void
populateUserAuthorities
(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser) Fills authorities ofjmixUser
based on information from theoidcUser
toJmixUser
(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser) Transforms an object with user information to the instance of the user used by Jmix.
-
Constructor Details
-
BaseOidcUserMapper
public BaseOidcUserMapper()
-
-
Method Details
-
toJmixUser
Description copied from interface:OidcUserMapper
Transforms an object with user information to the instance of the user used by Jmix. Method implementations may also perform users synchronization, e.g. to store users in the database.- Specified by:
toJmixUser
in interfaceOidcUserMapper<T extends JmixOidcUser>
- Parameters:
oidcUser
- the object that stores information about the user received from the OpenID Provider- Returns:
- an instance of Jmix user that may be set into security context
-
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 ofjmixUser
based 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 ofjmixUser
based 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
-
-