Class OidcReactiveOAuth2UserService

java.lang.Object
org.springframework.security.oauth2.client.oidc.userinfo.OidcReactiveOAuth2UserService
All Implemented Interfaces:
ReactiveOAuth2UserService<OidcUserRequest,OidcUser>

public class OidcReactiveOAuth2UserService extends Object implements ReactiveOAuth2UserService<OidcUserRequest,OidcUser>
An implementation of an ReactiveOAuth2UserService that supports OpenID Connect 1.0 Provider's.
Since:
5.1
See Also:
  • Constructor Details

    • OidcReactiveOAuth2UserService

      public OidcReactiveOAuth2UserService()
  • Method Details

    • createDefaultClaimTypeConverters

      public static Map<String,org.springframework.core.convert.converter.Converter<Object,?>> createDefaultClaimTypeConverters()
      Returns the default Converter's used for type conversion of claim values for an OidcUserInfo.
      Returns:
      a Map of Converter's keyed by claim name
      Since:
      5.2
    • loadUser

      public reactor.core.publisher.Mono<OidcUser> loadUser(OidcUserRequest userRequest) throws OAuth2AuthenticationException
      Description copied from interface: ReactiveOAuth2UserService
      Returns an OAuth2User after obtaining the user attributes of the End-User from the UserInfo Endpoint.
      Specified by:
      loadUser in interface ReactiveOAuth2UserService<OidcUserRequest,OidcUser>
      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
    • setOauth2UserService

      public void setOauth2UserService(ReactiveOAuth2UserService<OAuth2UserRequest,OAuth2User> oauth2UserService)
    • setClaimTypeConverterFactory

      public final void setClaimTypeConverterFactory(Function<ClientRegistration,org.springframework.core.convert.converter.Converter<Map<String,Object>,Map<String,Object>>> claimTypeConverterFactory)
      Sets the factory that provides a Converter used for type conversion of claim values for an OidcUserInfo. The default is ClaimTypeConverter for all clients.
      Parameters:
      claimTypeConverterFactory - the factory that provides a Converter used for type conversion of claim values for a specific client
      Since:
      5.2
    • setRetrieveUserInfo

      public final void setRetrieveUserInfo(Predicate<OidcUserRequest> retrieveUserInfo)
      Sets the Predicate used to determine if the UserInfo Endpoint should be called to retrieve information about the End-User (Resource Owner).

      By default, the UserInfo Endpoint is called if all the following are true:

      Parameters:
      retrieveUserInfo - the Predicate used to determine if the UserInfo Endpoint should be called
      Since:
      6.3
    • setOidcUserConverter

      public void setOidcUserConverter(org.springframework.core.convert.converter.Converter<OidcUserSource,reactor.core.publisher.Mono<OidcUser>> oidcUserConverter)
      Allows converting from the OidcUserSource to and OidcUser.
      Parameters:
      oidcUserConverter - the Converter to use. Cannot be null.