Class BearerTokenAuthenticationExtractor
java.lang.Object
org.springframework.graphql.server.support.BearerTokenAuthenticationExtractor
- All Implemented Interfaces:
AuthenticationExtractor
public final class BearerTokenAuthenticationExtractor
extends Object
implements AuthenticationExtractor
AuthenticationExtractor
that extracts a
bearer token.- Since:
- 1.3.0
- Author:
- Joshua Cummings, Rossen Stoyanchev
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default key to access Authorization value inconnection_init
payload. -
Constructor Summary
ConstructorDescriptionConstructor that defaults toAUTHORIZATION_KEY
for the payload key.BearerTokenAuthenticationExtractor
(String authorizationKey) Constructor with the key for the authorization value. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<org.springframework.security.core.Authentication>
getAuthentication
(Map<String, Object> payload) Return the authentication contained in the given payload, or an emptyMono
.
-
Field Details
-
AUTHORIZATION_KEY
Default key to access Authorization value inconnection_init
payload.- See Also:
-
-
Constructor Details
-
BearerTokenAuthenticationExtractor
public BearerTokenAuthenticationExtractor()Constructor that defaults toAUTHORIZATION_KEY
for the payload key. -
BearerTokenAuthenticationExtractor
Constructor with the key for the authorization value.- Parameters:
authorizationKey
- the key under which to look up the authorization value in the"connection_init"
payload.
-
-
Method Details
-
getAuthentication
public reactor.core.publisher.Mono<org.springframework.security.core.Authentication> getAuthentication(Map<String, Object> payload) Description copied from interface:AuthenticationExtractor
Return the authentication contained in the given payload, or an emptyMono
.- Specified by:
getAuthentication
in interfaceAuthenticationExtractor
- Parameters:
payload
- the payload to extract the authentication value from
-