Class OpaqueTokenReactiveAuthenticationManager
java.lang.Object
org.springframework.security.oauth2.server.resource.authentication.OpaqueTokenReactiveAuthenticationManager
- All Implemented Interfaces:
ReactiveAuthenticationManager
public class OpaqueTokenReactiveAuthenticationManager
extends Object
implements ReactiveAuthenticationManager
An
ReactiveAuthenticationManager
implementation for opaque
Bearer
Tokens, using an
OAuth 2.0 Introspection
Endpoint to check the token's validity and reveal its attributes.
This ReactiveAuthenticationManager
is responsible for introspecting and
verifying an opaque access token, returning its attributes set as part of the
Authentication
statement.
Scopes are translated into GrantedAuthority
s according to the following
algorithm:
- If there is a "scope" attribute, then convert to a
Collection
ofString
s. - Take the resulting
Collection
and prepend the "SCOPE_" keyword to each element, adding asGrantedAuthority
s.
- Since:
- 5.2
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates aOpaqueTokenReactiveAuthenticationManager
with the provided parameters -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Authentication>
authenticate
(Authentication authentication) Attempts to authenticate the providedAuthentication
-
Constructor Details
-
OpaqueTokenReactiveAuthenticationManager
Creates aOpaqueTokenReactiveAuthenticationManager
with the provided parameters- Parameters:
introspector
- TheReactiveOpaqueTokenIntrospector
to use
-
-
Method Details
-
authenticate
Description copied from interface:ReactiveAuthenticationManager
Attempts to authenticate the providedAuthentication
- Specified by:
authenticate
in interfaceReactiveAuthenticationManager
- Parameters:
authentication
- theAuthentication
to test- Returns:
- if authentication is successful an
Authentication
is returned. If authentication cannot be determined, an empty Mono is returned. If authentication fails, a Mono error is returned.
-