spring-projects / spring-projects/spring-security

CsrfDsl does not have a spa() configuration method.

Open
#18,332 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
According to the documentation, org.springframework.security.config.annotation.web.CsrfDsl should have a spa() configuration method, but it doesn't.
https://docs.spring.io/spring-security/reference/servlet/exploits/csrf.html#csrf-integration-javascript-spa

Image

To Reproduce

    @Bean
    open fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
        http {
            // ...
            csrf {
                spa()
            }
        }
        return http.build()
    }

Expected behavior
According to the documentation, CsrfDsl should have a spa() configuration method.

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 by reading the CsrfDsl API and the linked CSRF SPA documentation section, then reproduce the Kotlin securityFilterChain example from the issue. Confirm whether the documented spa() configuration is missing from the DSL or the documentation; done means the example and the available API agree and are covered by the relevant project tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin, spring
Domain
security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.