Class AuthenticationWebSocketInterceptor
java.lang.Object
org.springframework.graphql.server.support.AbstractAuthenticationWebSocketInterceptor
org.springframework.graphql.server.webmvc.AuthenticationWebSocketInterceptor
- All Implemented Interfaces:
WebGraphQlInterceptor
,WebSocketGraphQlInterceptor
public final class AuthenticationWebSocketInterceptor
extends AbstractAuthenticationWebSocketInterceptor
Extension of
AbstractAuthenticationWebSocketInterceptor
for use with
the WebMVC 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
ConstructorDescriptionAuthenticationWebSocketInterceptor
(AuthenticationExtractor authExtractor, org.springframework.security.authentication.AuthenticationManager authManager) -
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 authenticatedSecurityContext
or an error.protected reactor.util.context.ContextView
getContextToWrite
(org.springframework.security.core.context.SecurityContext securityContext) Subclasses implement this to decide how to insert theSecurityContext
into the Reactor context of theWebSocketGraphQlInterceptor
chain.Methods inherited from class org.springframework.graphql.server.support.AbstractAuthenticationWebSocketInterceptor
handleConnectionInitialization, intercept
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.graphql.server.WebGraphQlInterceptor
andThen, apply
Methods inherited from interface org.springframework.graphql.server.WebSocketGraphQlInterceptor
handleCancelledSubscription, handleConnectionClosed
-
Constructor Details
-
AuthenticationWebSocketInterceptor
public AuthenticationWebSocketInterceptor(AuthenticationExtractor authExtractor, org.springframework.security.authentication.AuthenticationManager authManager)
-
-
Method Details
-
authenticate
protected reactor.core.publisher.Mono<org.springframework.security.core.Authentication> authenticate(org.springframework.security.core.Authentication authentication) Description copied from class:AbstractAuthenticationWebSocketInterceptor
Subclasses implement this method to return an authenticatedSecurityContext
or an error.- Specified by:
authenticate
in 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:AbstractAuthenticationWebSocketInterceptor
Subclasses implement this to decide how to insert theSecurityContext
into the Reactor context of theWebSocketGraphQlInterceptor
chain.- Specified by:
getContextToWrite
in classAbstractAuthenticationWebSocketInterceptor
- Parameters:
securityContext
- theSecurityContext
to write to the context
-