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 String
    getOidcUserUsername(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser)
    Extracts username from the oidcUser
    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)
    Method returns an instance of Jmix user, which is enriched with additional data.

    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

    • getOidcUserUsername

      protected abstract String getOidcUserUsername(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser)
      Extracts username from the oidcUser
      Returns:
      username
    • toJmixUser

      public T toJmixUser(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser)
      Method returns an instance of Jmix user, which is enriched with additional data.
      Specified by:
      toJmixUser in interface OidcUserMapper<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 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 -