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 anOAuth2UserService
that simply delegates to it's internalList
ofOAuth2UserService
(s).Each
OAuth2UserService
is given a chance toload
anOAuth2User
with the firstnon-null
OAuth2User
being returned.- Since:
- 5.0
- See Also:
OAuth2UserService
,OAuth2UserRequest
,OAuth2User
-
-
Constructor Summary
Constructors Constructor Description DelegatingOAuth2UserService(java.util.List<OAuth2UserService<R,U>> userServices)
Constructs aDelegatingOAuth2UserService
using the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description U
loadUser(R userRequest)
Returns anOAuth2User
after 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 aDelegatingOAuth2UserService
using the provided parameters.- Parameters:
userServices
- aList
ofOAuth2UserService
(s)
-
-
Method Detail
-
loadUser
public U loadUser(R userRequest) throws OAuth2AuthenticationException
Description copied from interface:OAuth2UserService
Returns anOAuth2User
after obtaining the user attributes of the End-User from the UserInfo Endpoint.- Specified by:
loadUser
in 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
-
-