spring-projects / spring-projects/spring-security

Logout URL does not support "OPTIONS" request

Open
#6,903 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: config
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 /logout URL
  • The response is a 404 Not Found
Expected Behavior

Potentially:

  • Make an"OPTIONS" request to the /logout URL
  • 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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.