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 Object
implements OAuth2UserService<R,U>
An implementation of an
OAuth2UserService
that simply delegates to it's
internal List
of OAuth2UserService
(s).
Each OAuth2UserService
is given a chance to
load
an OAuth2User
with
the first non-null
OAuth2User
being returned.
- Since:
- 5.0
- See Also:
-
Constructor Summary
ConstructorDescriptionDelegatingOAuth2UserService
(List<OAuth2UserService<R, U>> userServices) Constructs aDelegatingOAuth2UserService
using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns anOAuth2User
after obtaining the user attributes of the End-User from the UserInfo Endpoint.
-
Constructor Details
-
DelegatingOAuth2UserService
Constructs aDelegatingOAuth2UserService
using the provided parameters.- Parameters:
userServices
- aList
ofOAuth2UserService
(s)
-
-
Method Details
-
loadUser
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
-