java.lang.Object
org.springframework.security.config.annotation.web.configurers.oauth2.server.authorization.OidcUserInfoEndpointConfigurer

public final class OidcUserInfoEndpointConfigurer extends Object
Configurer for OpenID Connect 1.0 UserInfo Endpoint.
Since:
7.0
See Also:
  • Method Details

    • userInfoRequestConverter

      public OidcUserInfoEndpointConfigurer userInfoRequestConverter(org.springframework.security.web.authentication.AuthenticationConverter userInfoRequestConverter)
      Adds an AuthenticationConverter used when attempting to extract an UserInfo Request from HttpServletRequest to an instance of OidcUserInfoAuthenticationToken used for authenticating the request.
      Parameters:
      userInfoRequestConverter - an AuthenticationConverter used when attempting to extract an UserInfo Request from HttpServletRequest
      Returns:
      the OidcUserInfoEndpointConfigurer for further configuration
    • userInfoRequestConverters

      public OidcUserInfoEndpointConfigurer userInfoRequestConverters(Consumer<List<org.springframework.security.web.authentication.AuthenticationConverter>> userInfoRequestConvertersConsumer)
      Sets the Consumer providing access to the List of default and (optionally) added AuthenticationConverter's allowing the ability to add, remove, or customize a specific AuthenticationConverter.
      Parameters:
      userInfoRequestConvertersConsumer - the Consumer providing access to the List of default and (optionally) added AuthenticationConverter's
      Returns:
      the OidcUserInfoEndpointConfigurer for further configuration
    • authenticationProvider

      public OidcUserInfoEndpointConfigurer authenticationProvider(org.springframework.security.authentication.AuthenticationProvider authenticationProvider)
      Adds an AuthenticationProvider used for authenticating an OidcUserInfoAuthenticationToken.
      Parameters:
      authenticationProvider - an AuthenticationProvider used for authenticating an OidcUserInfoAuthenticationToken
      Returns:
      the OidcUserInfoEndpointConfigurer for further configuration
    • authenticationProviders

      public OidcUserInfoEndpointConfigurer authenticationProviders(Consumer<List<org.springframework.security.authentication.AuthenticationProvider>> authenticationProvidersConsumer)
      Sets the Consumer providing access to the List of default and (optionally) added AuthenticationProvider's allowing the ability to add, remove, or customize a specific AuthenticationProvider.
      Parameters:
      authenticationProvidersConsumer - the Consumer providing access to the List of default and (optionally) added AuthenticationProvider's
      Returns:
      the OidcUserInfoEndpointConfigurer for further configuration
    • userInfoResponseHandler

      public OidcUserInfoEndpointConfigurer userInfoResponseHandler(org.springframework.security.web.authentication.AuthenticationSuccessHandler userInfoResponseHandler)
      Sets the AuthenticationSuccessHandler used for handling an OidcUserInfoAuthenticationToken and returning the UserInfo Response.
      Parameters:
      userInfoResponseHandler - the AuthenticationSuccessHandler used for handling an OidcUserInfoAuthenticationToken
      Returns:
      the OidcUserInfoEndpointConfigurer for further configuration
    • errorResponseHandler

      public OidcUserInfoEndpointConfigurer errorResponseHandler(org.springframework.security.web.authentication.AuthenticationFailureHandler errorResponseHandler)
      Sets the AuthenticationFailureHandler used for handling an OAuth2AuthenticationException and returning the Error Response.
      Parameters:
      errorResponseHandler - the AuthenticationFailureHandler used for handling an OAuth2AuthenticationException
      Returns:
      the OidcUserInfoEndpointConfigurer for further configuration
    • userInfoMapper

      public OidcUserInfoEndpointConfigurer userInfoMapper(Function<org.springframework.security.oauth2.server.authorization.oidc.authentication.OidcUserInfoAuthenticationContext,org.springframework.security.oauth2.core.oidc.OidcUserInfo> userInfoMapper)
      Sets the Function used to extract claims from OidcUserInfoAuthenticationContext to an instance of OidcUserInfo for the UserInfo response.

      The OidcUserInfoAuthenticationContext gives the mapper access to the OidcUserInfoAuthenticationToken, as well as, the following context attributes:

      • OidcUserInfoAuthenticationContext.getAccessToken() containing the bearer token used to make the request.
      • OidcUserInfoAuthenticationContext.getAuthorization() containing the OidcIdToken and OAuth2AccessToken associated with the bearer token used to make the request.
      Parameters:
      userInfoMapper - the Function used to extract claims from OidcUserInfoAuthenticationContext to an instance of OidcUserInfo
      Returns:
      the OidcUserInfoEndpointConfigurer for further configuration
    • postProcess

      protected final <T> T postProcess(T object)
    • getObjectPostProcessor

      protected final ObjectPostProcessor<Object> getObjectPostProcessor()