转发到登录页面而不是Spring Security中的重定向

问题描述 投票:0回答:1

使用Spring Security,如何将(服务器端重定向)转发到登录页面而不是重定向到它?

会话管理和无效会话URL的问题相同。

redirect spring-security forward
1个回答
1
投票

我同意@ holmis83,从重定向切换到转发并不是一个好主意。

Spring Security API documentation表明这可以通过使用setUseForward方法完成。您可以在配置中实例化LoginUrlAuthenticationEntryPoint,设置为true并将此实例传递给Spring Security HTTP元素。

© www.soinside.com 2019 - 2024. All rights reserved.