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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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 of jmixUser based on information from the oidcUser
    protected abstract void
    populateUserAuthorities(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser)
    Fills authorities of jmixUser based on information from the oidcUser
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseOidcUserMapper

      public BaseOidcUserMapper()
  • Method Details

    • toJmixUser

      public T toJmixUser(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser)
      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 interface OidcUserMapper<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 of jmixUser based on information from the oidcUser
      Parameters:
      oidcUser -
      jmixUser -
    • populateUserAuthorities

      protected abstract void populateUserAuthorities(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser, T jmixUser)
      Fills authorities of jmixUser based on information from the oidcUser
      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 the SynchronizingOidcUserMapper
      Parameters:
      oidcUser -
      jmixUser -