spring-cloud / spring-cloud/spring-cloud-gateway
Allow client first message authentication for websockets
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
Is your feature request related to a problem? Please describe.
Using the first message of the websocket as the client authentication seems to be an established practice (see for example https://github.com/whatwg/websockets/issues/16#issuecomment-4846373821 ) (alternative to using the http handshake with cookies or query parameter or basic auth or subprotocol for browsers where setting the Authorization header is not possible). It is currently not easily doable with spring cloud gateway.
Describe the solution you'd like
Allow the gateway to implement security when the auth comes in the first client message. Any API that would help with this would be nice. Since there are many imaginable ways to allow this and a lot of details, I can discuss further if this is interesting ?
Describe alternatives you've considered
Other authentication mecanisms
Additional context
I saw https://github.com/spring-cloud/spring-cloud-gateway/issues/1940 where modifying the websocket messages was not supported, ideally for this one the first authenticating message would not be relayed downstream, hopefully this simpler behavior of swalling a single message is ok ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Spring Cloud Gateway's WebSocket handling and the discussion in issue #1940 about modifying WebSocket messages. Define the API and authentication flow for accepting credentials in the first client message, including whether that message is withheld from downstream; done requires an agreed scope and corresponding gateway behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, authentication
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100