public class CustomUserTypesOAuth2UserService extends java.lang.Object implements OAuth2UserService<OAuth2UserRequest,org.springframework.security.oauth2.core.user.OAuth2User>
OAuth2UserService that supports custom OAuth2User types.
The custom user type(s) is supplied via the constructor,
using a Map of OAuth2User type(s) keyed by String,
which represents the Registration Id of the Client.
OAuth2UserService,
OAuth2UserRequest,
OAuth2User,
ClientRegistration| Constructor and Description |
|---|
CustomUserTypesOAuth2UserService(java.util.Map<java.lang.String,java.lang.Class<? extends org.springframework.security.oauth2.core.user.OAuth2User>> customUserTypes)
Constructs a
CustomUserTypesOAuth2UserService using the provided parameters. |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.oauth2.core.user.OAuth2User |
loadUser(OAuth2UserRequest userRequest)
Returns an
OAuth2User after obtaining the user attributes of the End-User from the UserInfo Endpoint. |
public CustomUserTypesOAuth2UserService(java.util.Map<java.lang.String,java.lang.Class<? extends org.springframework.security.oauth2.core.user.OAuth2User>> customUserTypes)
CustomUserTypesOAuth2UserService using the provided parameters.customUserTypes - a Map of OAuth2User type(s) keyed by Registration Idpublic org.springframework.security.oauth2.core.user.OAuth2User loadUser(OAuth2UserRequest userRequest) throws org.springframework.security.oauth2.core.OAuth2AuthenticationException
OAuth2UserServiceOAuth2User after obtaining the user attributes of the End-User from the UserInfo Endpoint.loadUser in interface OAuth2UserService<OAuth2UserRequest,org.springframework.security.oauth2.core.user.OAuth2User>userRequest - the user requestOAuth2Userorg.springframework.security.oauth2.core.OAuth2AuthenticationException - if an error occurs while attempting to obtain the user attributes from the UserInfo Endpoint