public class DefaultReactiveOAuth2UserService extends java.lang.Object implements ReactiveOAuth2UserService<OAuth2UserRequest,OAuth2User>
ReactiveOAuth2UserService
that supports standard OAuth
2.0 Provider's.
For standard OAuth 2.0 Provider's, the attribute name used to access the user's name
from the UserInfo response is required and therefore must be available via
UserInfoEndpoint.getUserNameAttributeName()
.
NOTE: Attribute names are not standardized between providers and therefore will vary. Please consult the provider's API documentation for the set of supported user attribute names.
ReactiveOAuth2UserService
,
OAuth2UserRequest
,
OAuth2User
,
DefaultOAuth2User
Constructor and Description |
---|
DefaultReactiveOAuth2UserService() |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<OAuth2User> |
loadUser(OAuth2UserRequest userRequest)
Returns an
OAuth2User after obtaining the user attributes of the End-User
from the UserInfo Endpoint. |
void |
setWebClient(org.springframework.web.reactive.function.client.WebClient webClient)
Sets the
WebClient used for retrieving the user endpoint |
public reactor.core.publisher.Mono<OAuth2User> loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException
ReactiveOAuth2UserService
OAuth2User
after obtaining the user attributes of the End-User
from the UserInfo Endpoint.loadUser
in interface ReactiveOAuth2UserService<OAuth2UserRequest,OAuth2User>
userRequest
- the user requestOAuth2User
OAuth2AuthenticationException
- if an error occurs while attempting to obtain
the user attributes from the UserInfo Endpointpublic void setWebClient(org.springframework.web.reactive.function.client.WebClient webClient)
WebClient
used for retrieving the user endpointwebClient
- the client to use