Carlos,

Your applications (app-b and app-c) need to process the logout request.
To see what CAS does during logout, and what URLs it calls for your apps, put 
these in your CAS log4j2.xml

        <!-- DEBUG service status and logout process and a lot of details -->
        <AsyncLogger name="org.apereo.cas.logout" level="debug" />
        <!-- INFO  logout operations for [TGT-... and [number] logout requests 
were processed
             DEBUG ST, principal and URL -->
        <AsyncLogger name="org.apereo.cas.logout.DefaultLogoutManager" 
level="debug">
            <Filters>
                <ThresholdFilter level="INFO" onMatch="ACCEPT" 
onMismatch="NEUTRAL" />
                <RegexFilter regex="Captured logout request.*" 
onMismatch="DENY" />
            </Filters>
        </AsyncLogger>
        <!-- DEBUG Logout request will be sent to but does not print anything 
when login was through SAML 1.1 -->
        <AsyncLogger 
name="org.apereo.cas.logout.DefaultSingleLogoutServiceLogoutUrlBuilder" 
level="debug" />
        <!-- DEBUG preparing, processing and logout with URL and ST -->
        <AsyncLogger 
name="org.apereo.cas.logout.DefaultSingleLogoutServiceMessageHandler" 
level="debug" />

Ray

On Tue, 2017-12-19 at 09:54 -0600, carlos maddaleno cuellar wrote:
Hi i have a question to make you gays,

I'm a new in CAS so i have a question to make, i authenticate my applications 
with the CAS server but when i log out from one aplication i still be log in 
the another application for example.

I have an application cal app-b and another call app-c, so when i clic on the 
logout button from the app-c it log out succesfully and when i try to get into 
the app-c again it shows me the login window but if i turn to the app-b it 
stiil have a validate session so i have to log out from it, so i wanted to know 
how to log out from the two application at the same time, im using the next 
method to log out

public void logout() {
        Factory<org.apache.shiro.mgt.SecurityManager> factory = new 
IniSecurityManagerFactory("classpath:shiro.ini");
        org.apache.shiro.mgt.SecurityManager securityManager = 
factory.getInstance();
        SecurityUtils.setSecurityManager(securityManager);
        if (SecurityUtils.getSubject() != null) {
            SecurityUtils.getSubject().logout();
        }
        redirectToLogOut();
    }

private void redirectToLogOut() {
        try {
            HttpServletRequest request = (HttpServletRequest) 
FacesContext.getCurrentInstance().getExternalContext().getRequest();
            /*String url = request.getRequestURL().toString();
             String baseURL = url.substring(0, url.length() - 
request.getRequestURI().length()) + request.getContextPath() + "/";*/
            URL reconstructedURL;

            switch (request.getServerName()) {
                case "siampv5.mp<http://siampv5.mp>":
                    reconstructedURL = new URL(request.getScheme(),
                            "siamp.mp<http://siamp.mp>",
                            request.getServerPort(), ""
                    );
                    break;
                case "siampv3.mp<http://siampv3.mp>":
                    reconstructedURL = new URL(request.getScheme(),
                            "siamp.mp<http://siamp.mp>",
                            request.getServerPort(), ""
                    );
                    break;
                default:
                    reconstructedURL = new URL(request.getScheme(),
                            request.getServerName(),
                            request.getServerPort(), ""
                    );
                    break;
            }
            reconstructedURL.toString();
            log.info<http://log.info>(String.format("ReconstructedURL: %s", 
reconstructedURL.toString()));
            //log.info<http://log.info>(String.format("BaseURL obtained: %s", 
baseURL));
            
FacesContext.getCurrentInstance().getExternalContext().redirect(reconstructedURL.toString()
 + "/cas/logout");
            
FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
        } catch (IOException ex) {
            log.error(ex);
        }
    }

thanks a lot


--
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | [email protected]

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/1513704624.1789.16.camel%40uvic.ca.

Reply via email to