Class CustomUserTypesOAuth2UserService
- java.lang.Object
-
- org.springframework.security.oauth2.client.userinfo.CustomUserTypesOAuth2UserService
-
- All Implemented Interfaces:
OAuth2UserService<OAuth2UserRequest,OAuth2User>
@Deprecated public class CustomUserTypesOAuth2UserService extends java.lang.Object implements OAuth2UserService<OAuth2UserRequest,OAuth2User>
Deprecated.It is recommended to use a delegation-based strategy of anOAuth2UserServiceto support customOAuth2Usertypes, as it provides much greater flexibility compared to this implementation. See the reference manual for details on how to implement.An implementation of anOAuth2UserServicethat supports customOAuth2Usertypes.The custom user type(s) is supplied via the constructor, using a
MapofOAuth2Usertype(s) keyed byString, which represents theRegistration Idof the Client.- Since:
- 5.0
- See Also:
OAuth2UserService,OAuth2UserRequest,OAuth2User,ClientRegistration
-
-
Constructor Summary
Constructors Constructor Description CustomUserTypesOAuth2UserService(java.util.Map<java.lang.String,java.lang.Class<? extends OAuth2User>> customUserTypes)Deprecated.Constructs aCustomUserTypesOAuth2UserServiceusing the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description OAuth2UserloadUser(OAuth2UserRequest userRequest)Deprecated.Returns anOAuth2Userafter obtaining the user attributes of the End-User from the UserInfo Endpoint.voidsetRequestEntityConverter(org.springframework.core.convert.converter.Converter<OAuth2UserRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)Deprecated.Sets theConverterused for converting theOAuth2UserRequestto aRequestEntityrepresentation of the UserInfo Request.voidsetRestOperations(org.springframework.web.client.RestOperations restOperations)Deprecated.Sets theRestOperationsused when requesting the UserInfo resource.
-
-
-
Constructor Detail
-
CustomUserTypesOAuth2UserService
public CustomUserTypesOAuth2UserService(java.util.Map<java.lang.String,java.lang.Class<? extends OAuth2User>> customUserTypes)
Deprecated.Constructs aCustomUserTypesOAuth2UserServiceusing the provided parameters.- Parameters:
customUserTypes- aMapofOAuth2Usertype(s) keyed byRegistration Id
-
-
Method Detail
-
loadUser
public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException
Deprecated.Description copied from interface:OAuth2UserServiceReturns anOAuth2Userafter obtaining the user attributes of the End-User from the UserInfo Endpoint.- Specified by:
loadUserin interfaceOAuth2UserService<OAuth2UserRequest,OAuth2User>- Parameters:
userRequest- the user request- Returns:
- an
OAuth2User - Throws:
OAuth2AuthenticationException- if an error occurs while attempting to obtain the user attributes from the UserInfo Endpoint
-
setRequestEntityConverter
public final void setRequestEntityConverter(org.springframework.core.convert.converter.Converter<OAuth2UserRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Deprecated.Sets theConverterused for converting theOAuth2UserRequestto aRequestEntityrepresentation of the UserInfo Request.- Parameters:
requestEntityConverter- theConverterused for converting to aRequestEntityrepresentation of the UserInfo Request- Since:
- 5.1
-
setRestOperations
public final void setRestOperations(org.springframework.web.client.RestOperations restOperations)
Deprecated.Sets theRestOperationsused when requesting the UserInfo resource.NOTE: At a minimum, the supplied
restOperationsmust be configured with the following:ResponseErrorHandler-OAuth2ErrorResponseErrorHandler
- Parameters:
restOperations- theRestOperationsused when requesting the UserInfo resource- Since:
- 5.1
-
-