OAuth2UserService
to support custom OAuth2User
types, as it provides
much greater flexibility compared to this implementation. See the
reference
manual for details on how to implement.@Deprecated public class CustomUserTypesOAuth2UserService extends java.lang.Object implements OAuth2UserService<OAuth2UserRequest,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 OAuth2User>> customUserTypes)
Deprecated.
Constructs a
CustomUserTypesOAuth2UserService using the provided
parameters. |
Modifier and Type | Method and Description |
---|---|
OAuth2User |
loadUser(OAuth2UserRequest userRequest)
Deprecated.
Returns an
OAuth2User after obtaining the user attributes of the End-User
from the UserInfo Endpoint. |
void |
setRequestEntityConverter(org.springframework.core.convert.converter.Converter<OAuth2UserRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Deprecated.
Sets the
Converter used for converting the OAuth2UserRequest to a
RequestEntity representation of the UserInfo Request. |
void |
setRestOperations(org.springframework.web.client.RestOperations restOperations)
Deprecated.
Sets the
RestOperations used when requesting the UserInfo resource. |
public CustomUserTypesOAuth2UserService(java.util.Map<java.lang.String,java.lang.Class<? extends OAuth2User>> customUserTypes)
CustomUserTypesOAuth2UserService
using the provided
parameters.customUserTypes
- a Map
of OAuth2User
type(s) keyed by
Registration Id
public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException
OAuth2UserService
OAuth2User
after obtaining the user attributes of the End-User
from the UserInfo Endpoint.loadUser
in interface OAuth2UserService<OAuth2UserRequest,OAuth2User>
userRequest
- the user requestOAuth2User
OAuth2AuthenticationException
- if an error occurs while attempting to obtain
the user attributes from the UserInfo Endpointpublic final void setRequestEntityConverter(org.springframework.core.convert.converter.Converter<OAuth2UserRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
Converter
used for converting the OAuth2UserRequest
to a
RequestEntity
representation of the UserInfo Request.requestEntityConverter
- the Converter
used for converting to a
RequestEntity
representation of the UserInfo Requestpublic final void setRestOperations(org.springframework.web.client.RestOperations restOperations)
RestOperations
used when requesting the UserInfo resource.
NOTE: At a minimum, the supplied restOperations
must be configured
with the following:
ResponseErrorHandler
- OAuth2ErrorResponseErrorHandler
restOperations
- the RestOperations
used when requesting the UserInfo
resource