Class DefaultJmixOidcUserService

java.lang.Object
org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService
io.jmix.oidc.userinfo.DefaultJmixOidcUserService
All Implemented Interfaces:
JmixOidcUserService, org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,org.springframework.security.oauth2.core.oidc.user.OidcUser>

public class DefaultJmixOidcUserService extends org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService implements JmixOidcUserService
A OidcUserService that is enabled by auto-configuration. In most cases you don't need to modify this class, all behaviour may be defined in OidcUserMapper.

Class delegates the loading of the OidcUser to the OidcUserService from Spring Security and then maps the user authorities to Jmix user authorities and creates a proper instance of OidcUser that may be used by the framework. The returned user must implement the JmixOidcUser interface.

The transformation from OidcUser to JmixOidcUser is delegated to the OidcUserMapper.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected OidcUserMapper<? extends JmixOidcUser>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.oauth2.core.oidc.user.OidcUser
    loadUser(org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest userRequest)
     
    protected JmixOidcUser
    obtainJmixOidcUser(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser)
    Obtains an instance of JmixOidcUser using the OidcUser.

    Methods inherited from class org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService

    createDefaultClaimTypeConverters, setAccessibleScopes, setClaimTypeConverterFactory, setOauth2UserService, setOidcUserMapper, setRetrieveUserInfo

    Methods inherited from class java.lang.Object

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

  • Constructor Details

  • Method Details

    • loadUser

      public org.springframework.security.oauth2.core.oidc.user.OidcUser loadUser(org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest userRequest) throws org.springframework.security.oauth2.core.OAuth2AuthenticationException
      Specified by:
      loadUser in interface org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.oidc.userinfo.OidcUserRequest,org.springframework.security.oauth2.core.oidc.user.OidcUser>
      Overrides:
      loadUser in class org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService
      Throws:
      org.springframework.security.oauth2.core.OAuth2AuthenticationException
    • obtainJmixOidcUser

      protected JmixOidcUser obtainJmixOidcUser(org.springframework.security.oauth2.core.oidc.user.OidcUser oidcUser)
      Obtains an instance of JmixOidcUser using the OidcUser. The instance of JmixOidcUser can be either created or obtained from the user repository.
      Parameters:
      oidcUser -
      Returns: