spring-projects / spring-security

Spring Security
http://spring.io/projects/spring-security
Apache License 2.0
8.57k stars 5.8k forks source link

In Spring Boot 3.0.2, `dispatcherServlet` is not working when combined with `filterChain` function #12659

Open JoeWang1127 opened 1 year ago

JoeWang1127 commented 1 year ago

I'm using spring-security in my project. After upgrading to Spring Boot 3.0.2, the dispatcherServlet seems not working.

I've composed a simple project here.

In the main branch, the project is backed by Spring Boot 2.7.8 and it's working.

Run the application Run curl localhost:8080/topsecret, the terminal will return {"timestamp":"2023-02-12T21:26:39.147+00:00","status":403,"error":"Forbidden","path":"/topsecret"}

In the spring-boot3 branch, the project is backed by Spring Boot 3.0.0 and it's not working

Run the application Run curl localhost:8080/topsecret in the terminal and nothing returns. Note that apart from the dependency change, I only changed antMatchers to requestMatchers in here. Additional reference on the spring-security's filterChain function.

JoeWang1127 commented 1 year ago

Issue #11958 maybe related to this one, per @wilkinsona