spring-projects / spring-projects/spring-security

Improve documentation about CRSF and WebSocket

Open
#4,579 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

I am with the current problem described here:

And seems the following is mandatory ('possible' answer/solution):

The current Spring Security Reference Documentation in the 23. WebSocket Security section, "practically" does not teach how configure Spring Security with WebSocket and keeping CSRF.

Thus, by the moment I must disable CRSF, therefore override the sameOriginDisabled method

@Override
 protected boolean sameOriginDisabled() {
       return true;
 }

The problem is I don't want disable CRSF, thus avoid override the sameOriginDisabled method , but this 'missing' stompWebSocketHandlerMapping problem arises.

Not sure if it is a bug or something else is need it to be configured, if is the latter it must be included in the reference documentation.

Thus for this post consider the scenario about never override the sameOriginDisabled method and define/configure the stompWebSocketHandlerMapping bean that is expected.

Thank You

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Spring Security Reference Documentation's WebSocket Security section and compare it with the configuration described in the issue and linked discussions. The documentation is done when it explains how to use WebSocket security while retaining CSRF, including the expected stompWebSocketHandlerMapping configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
documentation, security
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.