简体   繁体   English

如何在Spring应用程序中处理注销

[英]How to handle logout in spring application

I have spring app on which the logout is not implemented properly. 我有一个Spring应用程序,在该应用程序上无法正确实现注销。 when i click on my menu option it opens new windows for "ABC" application. 当我单击菜单选项时,它将为“ ABC”应用程序打开新窗口。 so when i clicks on log-out it log-out from whole application, my intention is to log out from "ABC" application not from whole application. 因此,当我单击“注销”时,它是从整个应用程序注销,我的意图是从“ ABC”应用程序注销,而不是从整个应用程序注销。 Please advice how should implement this log-out functionality. 请提出如何实施此注销功能的建议。 Is it possible to create new session on menu option and when i clicks on log out then it remove newly created session? 是否可以在菜单选项上创建新会话,当我单击注销然后删除新创建的会话时?

In a simple scheme, all you need to do is arrange that your application logout button sends the browser to <context-path>/j_spring_security_logout , where <context-path> is your webapp's context path. 在一个简单的方案中,您需要做的就是安排您的应用程序注销按钮将浏览器发送到<context-path>/j_spring_security_logout ,其中<context-path>是您的Webapp的上下文路径。

You also need a <logout> element in your <http> element to tell SpringSecurity to configure the logout filter. 您还需要在<http>元素中使用一个<logout>元素,以告诉SpringSecurity配置注销过滤器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM