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 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: