2009-12-17 136 views
0

我在WAS 6.1上使用JAAS的WebApplication已經在工作。以有序的方式驗證和授權。但是我的註銷頁面並未取消對委託人的授權。此應用程序在Glasfish上的JBoss上正常工作,但不在WAS上正常工作。Websphere 6.1 JAAS註銷

我的註銷頁面只是一個簡單的JSP內容。

<%System.out.println("principal is not null:"+(null != request.getUserPrincipal())); 

if (null != request.getSession(false)) 
request.getSession(false).invalidate(); 
%><jsp:include page="/index.html" /> 

我錯過了什麼嗎?我會主張不使用Webpshere中的任何特定API,但如果絕對需要,我會這樣做。

回答

2

爲了成功地註銷也需要此代碼段:

try { 
     com.ibm.websphere.security.WSSecurityHelper.revokeSSOCookies(request, response); 
    } catch(Exception e) { 
     // catch all possible exceptions if you want or handle them separately 
     out.println("JAASLogoutServlet: logout Exception = " + e.getMessage()); 
     throw new ServletException(e); 
} 
+0

你是男人。這節省了我的一天。 – 2010-08-30 11:18:04

0

在WebSphere 8.5.5(也許在舊版本中,太),您可以設置自定義屬性。

安全 - >全局安全 - >自定義屬性

com.ibm.ws.security.web.logoutOnHTTPSessionExpire=true