spring-projects / spring-projects/spring-security
SEC-2887: Add secure(true) to FormLoginRequestBuilder
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Petar Tahchiev (Migrated from SEC-2887) said:
Hello,
my spring security configuration requres that /j_spring_security_check is invoked over HTTPS. So my tests:
mockMvc.perform(formLogin("/j_spring_security_check").user("pe6o").password("1234")).andExpect(status().isFound()).andExpect(
redirectedUrl("/my-account")).andExpect(authenticated());
fails with:
LoginPageControllerIntegrationTest.testLoginWithValidCredentials:60 Redirected URL expected:</my-account> but was:<https://localhost/j_spring_security_check>
It is redirecting me to HTTPS and I cannot set .secure(true) on the form request.
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
Locate FormLoginRequestBuilder and its formLogin entry point; inspect how the request is built and how other request options are exposed. Verify that formLogin(...).secure(true) can exercise an HTTPS-only configuration without redirecting to HTTPS, using the configuration and failing behavior described in the issue as the completion check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- security, testing
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100