3

环境

  • Richfaces 3.3.3
  • JSF 1.2
  • 站点管理员

要求

用户输入所需的应用程序地址。Siteminder 拦截并询问用户名和密码。客户提供凭据。客户使用应用程序并单击注销/退出按钮。应用程序销毁会话并将 302 重定向到相同的应用程序地址,Siteminder 应该再次拦截。

问题

我正在尝试从从 siteminder 登录的richfaces 应用程序中注销。注销后,而不是进入站点管理器的登录页面,它返回到应用程序的主页。似乎它正在杀死应用程序会话而不是站点管理员会话。有没有办法注销 siteminder ?

代码

public String logout() {
    ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
    HttpSession session = (HttpSession)ec.getSession(false);

    if (session != null) {
        session.invalidate();
    }

    try {
        String redirectPath = "https://abcd.xyz.com/context/start.jsf";
        ec.redirect(redirectPath);
    } catch (IOException e) {
        e.printStackTrace();
    }

return null;

日志

com.ibm.ws.webcontainer.servlet.ServletWrapper doDestroy SRVE0253I [hostname] [/context] [uri]:销毁成功。com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I [hostname] [/context] [uri]:初始化成功。

4

2 回答 2

2

如果标头中的 SM_USER 值为空/空,我会在 servletfilter 中使用以下代码强制执行重定向。

if(servletPath.trim().equals("/login/logout.do")){
                    log.debug("User Logged Out. Redirecting to " + contextPath + homeLink);
                    RequestDispatcher rd = request.getRequestDispatcher(homeLink);
                    rd.forward(request, response);
                    return;                 
                } 
于 2012-07-03T16:58:20.087 回答
0

您需要更新托管应用程序的 Web 代理的代理配置对象 (ACO)。LogOffUri 参数指示 SiteMinder Web Agent 销毁 SMSESSION(实际上将值设置为 LOGGEDOFF)。

如果您将 LogOffUri ACO 参数中指定的 URI 配置为将用户重定向回应用程序的主 URL,则 WebAgent 将检测到 SMSESSION 无效并将用户发送到登录页面。

于 2015-08-18T16:10:38.353 回答