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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Used to buildSpringReactiveOpaqueTokenIntrospector
. -
Constructor Summary
ConstructorsConstructorDescriptionSpringReactiveOpaqueTokenIntrospector
(String introspectionUri, String clientId, String clientSecret) Deprecated, for removal: This API element is subject to removal in a future version.SpringReactiveOpaqueTokenIntrospector
(String introspectionUri, org.springframework.web.reactive.function.client.WebClient webClient) Creates aOpaqueTokenReactiveAuthenticationManager
with the provided parameters -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<OAuth2AuthenticatedPrincipal>
introspect
(String token) Introspect and verify the given token, returning its attributes.void
setAuthenticationConverter
(org.springframework.core.convert.converter.Converter<OAuth2TokenIntrospectionClaimAccessor, reactor.core.publisher.Mono<? extends OAuth2AuthenticatedPrincipal>> authenticationConverter) Sets theConverter<OAuth2TokenIntrospectionClaimAccessor, OAuth2AuthenticatedPrincipal>
to use.withIntrospectionUri
(String introspectionUri) Creates aSpringReactiveOpaqueTokenIntrospector.Builder
with the given introspection endpoint uri
-
Constructor Details
-
SpringReactiveOpaqueTokenIntrospector
@Deprecated(since="6.5", forRemoval=true) public SpringReactiveOpaqueTokenIntrospector(String introspectionUri, String clientId, String clientSecret) Deprecated, for removal: This API element is subject to removal in a future version.Creates aOpaqueTokenReactiveAuthenticationManager
with the provided parameters- Parameters:
introspectionUri
- The introspection endpoint uriclientId
- The URL-encoded client id authorized to introspectclientSecret
- The URL-encoded client secret authorized to introspect
-
SpringReactiveOpaqueTokenIntrospector
public SpringReactiveOpaqueTokenIntrospector(String introspectionUri, org.springframework.web.reactive.function.client.WebClient webClient) Creates aOpaqueTokenReactiveAuthenticationManager
with the provided parameters- Parameters:
introspectionUri
- The introspection endpoint uriwebClient
- The client for performing the introspection request
-
-
Method Details
-
introspect
Description copied from interface:ReactiveOpaqueTokenIntrospector
Introspect and verify the given token, returning its attributes. Returning aMap
is indicative that the token is valid.- Specified by:
introspect
in interfaceReactiveOpaqueTokenIntrospector
- 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 todefaultAuthenticationConverter(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
-
withIntrospectionUri
public static SpringReactiveOpaqueTokenIntrospector.Builder withIntrospectionUri(String introspectionUri) Creates aSpringReactiveOpaqueTokenIntrospector.Builder
with the given introspection endpoint uri- Parameters:
introspectionUri
- The introspection endpoint uri- Returns:
- the
SpringReactiveOpaqueTokenIntrospector.Builder
- Since:
- 6.5
-
SpringReactiveOpaqueTokenIntrospector.Builder