Files
spring-graphql-examples/websocket-authentication/README.md
2024-05-23 16:55:56 +01:00

1.1 KiB

Overview

GraphQL over WebSocket with an authentication token passed through the "connection_init" message.

Configuration

WebMvcSecurityConfig and WebFluxSecurityConfig configure the AuthenticationWebSocketInterceptor to perform authentication. See the reference docs.

To switch between WebMvc or WebFlux as the transport, comment in and out spring-boot-starter-web and spring-boot-starter-websocket in build.gradle.

Running

  1. Run GreetingApplication from your IDE, or ./gradlew bootRun from the command line to start the server.
  2. Run GreetingClient, or ./gradlew clientRun to perform a subscription.

Or you can run the integration tests in GreetingApplicationTests.