Package io.jmix.oidc.userinfo
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:
-
JmixOidcUser
OAuth2UserService
OidcUserService
OidcUserMapper
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultJmixOidcUserService
(OidcUserMapper<? extends JmixOidcUser> userMapper) -
Method Summary
Modifier and TypeMethodDescriptionorg.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 ofJmixOidcUser
using theOidcUser
.Methods inherited from class org.springframework.security.oauth2.client.oidc.userinfo.OidcUserService
createDefaultClaimTypeConverters, setAccessibleScopes, setClaimTypeConverterFactory, setOauth2UserService
-
Field Details
-
userMapper
-
-
Constructor Details
-
DefaultJmixOidcUserService
-
-
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 interfaceorg.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 classorg.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 ofJmixOidcUser
using theOidcUser
. The instance ofJmixOidcUser
can be either created or obtained from the user repository.- Parameters:
oidcUser
-- Returns:
-