admin管理员组文章数量:1435270
I'm currently migrating my application to Spring Framework 6, which required updating the javax namespace to jakarta. While most components seem to be working, I’m facing an issue specifically with the authentication configuration and can’t pinpoint the cause.
Details: security.xml configuration:
<security:http authentication-manager-ref="authenticationManager" entry-point-ref="processingFilterEntryPoint" use-expressions="true">
<security:intercept-url pattern="/msui_login**" access="isAnonymous()" />
<security:intercept-url pattern="/**" access="isAuthenticated()" />
<security:custom-filter ref="processingFilter" after="LOGOUT_FILTER" />
<security:logout success-handler-ref="logoutSuccessHandler" />
<security:csrf disabled="true" />
<security:headers>
<security:frame-options policy="SAMEORIGIN" />
</security:headers>
</security:http>
<bean id="authenticationManager" class=".springframework.security.authentication.ProviderManager">
<constructor-arg>
<list>
<ref bean="authenticationProvider" />
</list>
</constructor-arg>
</bean>
I've verified that authenticationProvider is returning the correct Authentication object. However, for the pattern /**, when it checks isAuthenticated, control is being redirected to processingFilterEntryPoint instead. This suggests that Spring Security might not be handling the Authentication object as expected. Could there have been any changes in Spring Security 6.x affecting this behavior? Any insights or troubleshooting tips would be greatly appreciated.
Environment:
Spring Framework: 6.1.x
Spring Security: 6.3.x
Tomcat: 10.1.x
本文标签: javaUpgrading from Spring Framework 5 to 6 (Spring Security 572 to 634)Stack Overflow
版权声明:本文标题:java - Upgrading from Spring Framework 5 to 6 (Spring Security 5.7.2 to 6.3.4) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745617128a2666468.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论