Class SpringReactiveOpaqueTokenIntrospector

java.lang.Object
org.springframework.security.oauth2.server.resource.introspection.SpringReactiveOpaqueTokenIntrospector
All Implemented Interfaces:
ReactiveOpaqueTokenIntrospector

public class SpringReactiveOpaqueTokenIntrospector extends Object implements ReactiveOpaqueTokenIntrospector
A Spring implementation of ReactiveOpaqueTokenIntrospector that verifies and introspects a token using the configured OAuth 2.0 Introspection Endpoint.
Since:
5.6
  • Constructor Details

    • SpringReactiveOpaqueTokenIntrospector

      public SpringReactiveOpaqueTokenIntrospector(String introspectionUri, String clientId, String clientSecret)
      Creates a OpaqueTokenReactiveAuthenticationManager with the provided parameters
      Parameters:
      introspectionUri - The introspection endpoint uri
      clientId - The client id authorized to introspect
      clientSecret - The client secret for the authorized client
    • SpringReactiveOpaqueTokenIntrospector

      public SpringReactiveOpaqueTokenIntrospector(String introspectionUri, org.springframework.web.reactive.function.client.WebClient webClient)
      Creates a OpaqueTokenReactiveAuthenticationManager with the provided parameters
      Parameters:
      introspectionUri - The introspection endpoint uri
      webClient - The client for performing the introspection request
  • Method Details

    • introspect

      public reactor.core.publisher.Mono<OAuth2AuthenticatedPrincipal> introspect(String token)
      Description copied from interface: ReactiveOpaqueTokenIntrospector
      Introspect and verify the given token, returning its attributes. Returning a Map is indicative that the token is valid.
      Specified by:
      introspect in interface ReactiveOpaqueTokenIntrospector
      Parameters:
      token - the token to introspect
      Returns:
      the token's attributes
    • setAuthenticationConverter

      public void setAuthenticationConverter(org.springframework.core.convert.converter.Converter<OAuth2TokenIntrospectionClaimAccessor,reactor.core.publisher.Mono<? extends OAuth2AuthenticatedPrincipal>> authenticationConverter)

      Sets the Converter<OAuth2TokenIntrospectionClaimAccessor, OAuth2AuthenticatedPrincipal> to use. Defaults to defaultAuthenticationConverter(org.springframework.security.oauth2.core.OAuth2TokenIntrospectionClaimAccessor).

      Use if you need a custom mapping of OAuth 2.0 token claims to the authenticated principal.

      Parameters:
      authenticationConverter - the converter
      Since:
      6.3