spring-projects / spring-projects/spring-security
Logout URL does not support "OPTIONS" request
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
Summary
When making an "OPTIONS" request to the logout URL (default /logout) the response is a 404 Not Found.
Based on the following test, it should return a 200 OK.
https://github.com/spring-projects/spring-security/blob/af3c6d49728fc3b2270a07ce09827fb1e4890c6d/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/LogoutConfigurerTests.groovy#L106
However, the above test is configured using a MockFilterChain rather than the real FilterChain.
This may not be an issue, because this functionality has not been requested and the test above does not accurately reflect current fuctionality.
We should either deem the test invalid or implement this feature.
Actual Behavior
- Make an"OPTIONS" request to the
/logoutURL - The response is a
404 Not Found
Expected Behavior
Potentially:
- Make an"OPTIONS" request to the
/logoutURL - The response is a
200 OK
Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
.logout();
}
}
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
The issue points to config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/LogoutConfigurerTests.groovy at line 106; start by reviewing that test and how its MockFilterChain differs from the real FilterChain. Confirm whether the test should be changed or OPTIONS support should be implemented, then verify the chosen behavior for an OPTIONS request to /logout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100