After I migrate from Spring boot 2.1.0.RELEASE to Spring Boot 3.3.2

SecurityContextHolder default securityContextHolderStrategy is diffrent from AnonymousAuthentication securityContextHolderStrategy

Authentication rewrite by AnonymousAuthentication filter

 @Override
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
            throws IOException, ServletException {
        Supplier<SecurityContext> deferredContext = this.securityContextHolderStrategy.getDeferredContext();
        this.securityContextHolderStrategy
            .setDeferredContext(defaultWithAnonymous((HttpServletRequest) req, deferredContext));
        chain.doFilter(req, res);
    }

worked

```java @Override public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { Supplier deferredContext = SecurityContextHolder.getDeferredContext(); this.securityContextHolderStrategy .setDeferredContext(defaultWithAnonymous((HttpServletRequest) req, deferredContext)); chain.doFilter(req, res); }

Comment From: jzheaux

Hi, @luohuanyu, thanks for reaching out.

I'd like to look into this further for you, however I will need more information. Can you provide a minimal sample that demonstrates what is going wrong?

Comment From: luohuanyu

page not found

Comment From: ola-dotun

@luohuanyu https://stackoverflow.com/help/minimal-reproducible-example

Comment From: jzheaux

Sorry for the type, @luohuanyu, I've updated the link. Also, @ola-dotun, thank you for jumping in with a corrected link.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.