Class OpaqueTokenReactiveAuthenticationManager
- java.lang.Object
-
- org.springframework.security.oauth2.server.resource.authentication.OpaqueTokenReactiveAuthenticationManager
-
- All Implemented Interfaces:
org.springframework.security.authentication.ReactiveAuthenticationManager
public class OpaqueTokenReactiveAuthenticationManager extends java.lang.Object implements org.springframework.security.authentication.ReactiveAuthenticationManagerAnReactiveAuthenticationManagerimplementation for opaque Bearer Tokens, using an OAuth 2.0 Introspection Endpoint to check the token's validity and reveal its attributes.This
ReactiveAuthenticationManageris responsible for introspecting and verifying an opaque access token, returning its attributes set as part of theAuthenticationstatement.A
ReactiveOpaqueTokenIntrospectoris responsible for retrieving token attributes from an authorization server.A
ReactiveOpaqueTokenAuthenticationConverteris responsible for turning a successful introspection result into anAuthenticationinstance (which may include mappingGrantedAuthoritys from token attributes or retrieving from another source).- Since:
- 5.2
- See Also:
ReactiveAuthenticationManager
-
-
Constructor Summary
Constructors Constructor Description OpaqueTokenReactiveAuthenticationManager(ReactiveOpaqueTokenIntrospector introspector)Creates aOpaqueTokenReactiveAuthenticationManagerwith the provided parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<org.springframework.security.core.Authentication>authenticate(org.springframework.security.core.Authentication authentication)Introspect and validate the opaque Bearer Token and then delegatesAuthenticationinstantiation toReactiveOpaqueTokenAuthenticationConverter.voidsetAuthenticationConverter(ReactiveOpaqueTokenAuthenticationConverter authenticationConverter)Provide with a custom bean to turn successful introspection result into anAuthenticationinstance of your choice.
-
-
-
Constructor Detail
-
OpaqueTokenReactiveAuthenticationManager
public OpaqueTokenReactiveAuthenticationManager(ReactiveOpaqueTokenIntrospector introspector)
Creates aOpaqueTokenReactiveAuthenticationManagerwith the provided parameters- Parameters:
introspector- TheReactiveOpaqueTokenIntrospectorto use
-
-
Method Detail
-
authenticate
public reactor.core.publisher.Mono<org.springframework.security.core.Authentication> authenticate(org.springframework.security.core.Authentication authentication)
Introspect and validate the opaque Bearer Token and then delegatesAuthenticationinstantiation toReactiveOpaqueTokenAuthenticationConverter.If created Authentication is instance of
AbstractAuthenticationTokenand details are null, then introspection result details are used.- Specified by:
authenticatein interfaceorg.springframework.security.authentication.ReactiveAuthenticationManager- Parameters:
authentication- the authentication request object.- Returns:
- A successful authentication
-
setAuthenticationConverter
public void setAuthenticationConverter(ReactiveOpaqueTokenAuthenticationConverter authenticationConverter)
Provide with a custom bean to turn successful introspection result into anAuthenticationinstance of your choice. By default,BearerTokenAuthenticationwill be built.- Parameters:
authenticationConverter- the converter to use- Since:
- 5.8
-
-