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

我尝试:

request.getSession().invalidate();

但用户主体仍然关联。

我怎样才能删除该关联?

有帮助吗?

解决方案

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

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>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top