public final class OpaqueTokenAuthenticationProvider
extends java.lang.Object
implements org.springframework.security.authentication.AuthenticationProvider
AuthenticationProvider implementation for opaque
Bearer Tokens,
using an
OAuth 2.0 Introspection Endpoint
to check the token's validity and reveal its attributes.
This AuthenticationProvider is responsible for introspecting and verifying an opaque access token,
returning its attributes set as part of the Authentication statement.
Scopes are translated into GrantedAuthoritys according to the following algorithm:
Collection of Strings.
Collection and prepend the "SCOPE_" keyword to each element, adding as GrantedAuthoritys.
AuthenticationProvider| Constructor and Description |
|---|
OpaqueTokenAuthenticationProvider(OpaqueTokenIntrospector introspector)
Creates a
OpaqueTokenAuthenticationProvider with the provided parameters |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.security.core.Authentication |
authenticate(org.springframework.security.core.Authentication authentication)
Introspect and validate the opaque
Bearer Token.
|
boolean |
supports(java.lang.Class<?> authentication) |
public OpaqueTokenAuthenticationProvider(OpaqueTokenIntrospector introspector)
OpaqueTokenAuthenticationProvider with the provided parametersintrospector - The OpaqueTokenIntrospector to usepublic org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication)
throws org.springframework.security.core.AuthenticationException
authenticate in interface org.springframework.security.authentication.AuthenticationProviderauthentication - the authentication request object.org.springframework.security.core.AuthenticationException - if authentication failed for some reasonpublic boolean supports(java.lang.Class<?> authentication)
supports in interface org.springframework.security.authentication.AuthenticationProvider