Class CustomOAuth2UserService
- java.lang.Object
-
- org.drdeesw.commons.security.oauth2.client.userinfo.CustomOAuth2UserService
-
- All Implemented Interfaces:
org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest,org.springframework.security.oauth2.core.user.OAuth2User>
@Service public class CustomOAuth2UserService extends java.lang.Object implements org.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest,org.springframework.security.oauth2.core.user.OAuth2User>This is a copy of DefaultOAuth2UserService but using .get("data") to get userAttributes. As happens with Coinbase, for example.
-
-
Constructor Summary
Constructors Constructor Description CustomOAuth2UserService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.oauth2.core.user.OAuth2UserloadUser(org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest userRequest)voidsetRequestEntityConverter(org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)Sets theConverterused for converting theOAuth2UserRequestto aRequestEntityrepresentation of the UserInfo Request.voidsetRestOperations(org.springframework.web.client.RestOperations restOperations)Sets theRestOperationsused when requesting the UserInfo resource.
-
-
-
Method Detail
-
loadUser
public org.springframework.security.oauth2.core.user.OAuth2User loadUser(org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest userRequest) throws org.springframework.security.oauth2.core.OAuth2AuthenticationException- Specified by:
loadUserin interfaceorg.springframework.security.oauth2.client.userinfo.OAuth2UserService<org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest,org.springframework.security.oauth2.core.user.OAuth2User>- Throws:
org.springframework.security.oauth2.core.OAuth2AuthenticationException
-
setRequestEntityConverter
public final void setRequestEntityConverter(org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest,org.springframework.http.RequestEntity<?>> requestEntityConverter)
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)
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
-
-