Spring security Spring安全注销失败http-bio-8080“-exec-5“;栈溢出
我看过一些Spring注销的例子,对我来说有点抽象。我有一个href=“appcontext\u path/auth/logout.html”的链接。我看到的示例在auth文件夹中没有心灵logout.html。所以我假设这是一个幕后任务。我希望能够单击注销链接,使会话和任何相关cookie无效,并导航到登录页面(auth/login.html)。当我尝试下面的配置时,在线程“http-bio-8080”-exec-5”java.lang.StackOverflower中出现异常Spring security Spring安全注销失败http-bio-8080“-exec-5“;栈溢出,spring-security,Spring Security,我看过一些Spring注销的例子,对我来说有点抽象。我有一个href=“appcontext\u path/auth/logout.html”的链接。我看到的示例在auth文件夹中没有心灵logout.html。所以我假设这是一个幕后任务。我希望能够单击注销链接,使会话和任何相关cookie无效,并导航到登录页面(auth/login.html)。当我尝试下面的配置时,在线程“http-bio-8080”-exec-5”java.lang.StackOverflower中出现异常 <glo
<global-method-security secured-annotations="enabled">
</global-method-security>
<http security="none" pattern="/javax.faces.resource/**" />
<http security="none" pattern="/services/rest-api/1.0/**" />
<http security="none" pattern="/preregistered/**" />
<http access-denied-page="/auth/denied.html">
<intercept-url
pattern="/**/*.xhtml"
access="ROLE_NONE_GETS_ACCESS" />
<intercept-url
pattern="/auth/*"
access="ROLE_ANONYMOUS" />
<intercept-url
pattern="/registered/*"
access="ROLE_USER" />
<form-login
login-processing-url="/j_spring_security_check.html"
login-page="/auth/login.html"
default-target-url="/registered/home.html"
authentication-failure-url="/auth/login.html" />
<logout logout-url="/auth/logout.html"
logout-success-url="/auth/login.html" />
<anonymous username="guest" granted-authority="ROLE_ANONYMOUS"/>
<remember-me user-service-ref="userManager" key="ddddd23aferq3f3qrf"/>
</http>
<!-- Configure the authentication provider -->
<authentication-manager>
<authentication-provider user-service-ref="userManager">
<password-encoder ref="passwordEncoder" />
</authentication-provider>
</authentication-manager>
您在配置中有错误
导致Spring注销过滤器捕获logout.html
对logout.html
的请求(即对其自身)-这导致SOE
您应该为
注销url
和注销成功url
使用不同的url,只需删除标记
,并使用j_-spring\u-security\u-logout
作为注销功能的链接。注销url和注销成功url是不同的。我不明白你的评论。我想logout url属性只是说,一旦进入auth/logout.html页面,就会触发注销过程。