Class AuthenticationWebSocketInterceptor
java.lang.Object
org.springframework.graphql.server.support.AbstractAuthenticationWebSocketInterceptor
org.springframework.graphql.server.webflux.AuthenticationWebSocketInterceptor
- All Implemented Interfaces:
WebGraphQlInterceptor,WebSocketGraphQlInterceptor
public final class AuthenticationWebSocketInterceptor
extends AbstractAuthenticationWebSocketInterceptor
Extension of
AbstractAuthenticationWebSocketInterceptor for use with
the WebFlux GraphQL transport.- Since:
- 1.3.0
- Author:
- Joshua Cummings, Rossen Stoyanchev
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.graphql.server.WebGraphQlInterceptor
WebGraphQlInterceptor.Chain -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationWebSocketInterceptor(AuthenticationExtractor extractor, org.springframework.security.authentication.ReactiveAuthenticationManager manager) -
Method Summary
Modifier and TypeMethodDescriptionprotected reactor.core.publisher.Mono<org.springframework.security.core.Authentication>authenticate(org.springframework.security.core.Authentication authentication) Subclasses implement this method to return an authenticatedSecurityContextor an error.protected reactor.util.context.ContextViewgetContextToWrite(org.springframework.security.core.context.SecurityContext securityContext) Subclasses implement this to decide how to insert theSecurityContextinto the Reactor context of theWebSocketGraphQlInterceptorchain.Methods inherited from class org.springframework.graphql.server.support.AbstractAuthenticationWebSocketInterceptor
handleConnectionInitialization, interceptMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.graphql.server.WebGraphQlInterceptor
andThen, applyMethods inherited from interface org.springframework.graphql.server.WebSocketGraphQlInterceptor
handleCancelledSubscription, handleConnectionClosed
-
Constructor Details
-
AuthenticationWebSocketInterceptor
public AuthenticationWebSocketInterceptor(AuthenticationExtractor extractor, org.springframework.security.authentication.ReactiveAuthenticationManager manager)
-
-
Method Details
-
authenticate
protected reactor.core.publisher.Mono<org.springframework.security.core.Authentication> authenticate(org.springframework.security.core.Authentication authentication) Description copied from class:AbstractAuthenticationWebSocketInterceptorSubclasses implement this method to return an authenticatedSecurityContextor an error.- Specified by:
authenticatein classAbstractAuthenticationWebSocketInterceptor- Parameters:
authentication- the authentication value extracted from the payload
-
getContextToWrite
protected reactor.util.context.ContextView getContextToWrite(org.springframework.security.core.context.SecurityContext securityContext) Description copied from class:AbstractAuthenticationWebSocketInterceptorSubclasses implement this to decide how to insert theSecurityContextinto the Reactor context of theWebSocketGraphQlInterceptorchain.- Specified by:
getContextToWritein classAbstractAuthenticationWebSocketInterceptor- Parameters:
securityContext- theSecurityContextto write to the context
-