【问题标题】:JSF Siteminder logoutJSF Siteminder 注销
【发布时间】:2011-12-17 17:37:45
【问题描述】:

环境

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

要求

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

问题

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

代码

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]:初始化成功。

【问题讨论】:

    标签: jsf richfaces jsf-1.2 siteminder


    【解决方案1】:

    如果标头中的 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;                 
                    } 
    

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-09-22
        • 1970-01-01
        • 1970-01-01
        • 2014-02-14
        • 2011-11-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多