Class DelegatingOAuth2UserService<R extends OAuth2UserRequest,U extends OAuth2User>
- java.lang.Object
-
- org.springframework.security.oauth2.client.userinfo.DelegatingOAuth2UserService<R,U>
-
- Type Parameters:
R- The type of OAuth 2.0 User RequestU- The type of OAuth 2.0 User
- All Implemented Interfaces:
OAuth2UserService<R,U>
public class DelegatingOAuth2UserService<R extends OAuth2UserRequest,U extends OAuth2User> extends java.lang.Object implements OAuth2UserService<R,U>
An implementation of anOAuth2UserServicethat simply delegates to it's internalListofOAuth2UserService(s).Each
OAuth2UserServiceis given a chance toloadanOAuth2Userwith the firstnon-nullOAuth2Userbeing returned.- Since:
- 5.0
- See Also:
OAuth2UserService,OAuth2UserRequest,OAuth2User
-
-
Constructor Summary
Constructors Constructor Description DelegatingOAuth2UserService(java.util.List<OAuth2UserService<R,U>> userServices)Constructs aDelegatingOAuth2UserServiceusing the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UloadUser(R userRequest)Returns anOAuth2Userafter obtaining the user attributes of the End-User from the UserInfo Endpoint.
-
-
-
Constructor Detail
-
DelegatingOAuth2UserService
public DelegatingOAuth2UserService(java.util.List<OAuth2UserService<R,U>> userServices)
Constructs aDelegatingOAuth2UserServiceusing the provided parameters.- Parameters:
userServices- aListofOAuth2UserService(s)
-
-
Method Detail
-
loadUser
public U loadUser(R userRequest) throws OAuth2AuthenticationException
Description copied from interface:OAuth2UserServiceReturns anOAuth2Userafter obtaining the user attributes of the End-User from the UserInfo Endpoint.- Specified by:
loadUserin interfaceOAuth2UserService<R extends OAuth2UserRequest,U extends 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
-
-