Tuesday, July 2, 2013

How to perform SSO(Single Sign On) Logout in ADF application


SSO Logout , Redirecting to a specific page or URL in ADF application

Usecase : Provide SSO Logout functionality in ADF application

Implementation:

- Bind a backing bean method to command button as shown below

       <af:commandButton text="Logout" id="cb4" rendered="true"
                          action="#{pageFlowScope.Bean.sessionLogout}"
                          immediate="true"/>

- Redirect to /oamsso/logout.html?end_url=/portal.html as shown below


    public String sessionLogout() {
        String methodName = "sessionLogout(ActionEvent actionEvent)";
        _logger.entering(CLAZZ_NAME, methodName);
        try {
            ExternalContext ectx = FacesContext.getCurrentInstance().getExternalContext();
            ectx.redirect("/oamsso/logout.html?end_url=/portal.html");
        } catch (Exception e) {
            _logger.logp(Level.SEVERE, CLAZZ_NAME, methodName,
                         e.getMessage() + " while logging out: ", e);
        }
        return "back";
    }


No comments:

Post a Comment