gpt4 book ai didi

java - 如何从 Java EE 容器管理的安全性注销?

转载 作者:行者123 更新时间:2023-11-29 04:01:02 27 4
gpt4 key购买 nike

我在 websphere 7.0 中工作。我使用来自应用程序服务器的安全性。我想删除与用户的关联,以便在访问安全资源之前将用户重定向到登录页面(并且 request.getUserPrincipal() 返回 null)。

我试试:

request.getSession().invalidate();

但用户主体仍然关联。

我怎样才能删除该关联?

最佳答案

在 websphere 上,必须使用特殊的注销表单调用:

http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tsec_pofolo.html

这是我正在使用的:

<body onload="javascript:document.logout.submit()">
<h2>Sample Form Logout</h2>
<form METHOD=POST ACTION="ibm_security_logout" NAME="logout">
Click this button to log out:
<input type="submit" name="logout" value="Logout">
<INPUT TYPE="HIDDEN" name="logoutExitPage" VALUE="/some url">
</form>
</body>

关于java - 如何从 Java EE 容器管理的安全性注销?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3628796/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com