5
votes

while implementing jasig-CAS I've faced the next problem: I want to implement the logout. For now it works fine, but I want CAS server to redirect the user after logging out to the server where the request came from(for instance, http://localhost:8080/myApp). I've tried to add "service" in security context, but nothing happened here is a piece of my spring security context:

<security:logout logout-url="/logout"
                        logout-success-url="https://localhost:9543/cas-server-webapp-3.4.10/logout?service=http://localhost:8080/myApp" 
                        invalidate-session="true" />

all configs and procedures are taken from this manual.

2
Sorry for misleading you with redirect prefix, it was config of cas webflow. I deleted that answer. - Aleksandr M
About your issue: How exactly it is not working? Have you tried to put some simple url in logout-success-url parameter? - Aleksandr M
@AleksandrM now it logs out normally. BUT it logs out and goes to CAS logout page and I want to go(to be redirected) to myApp index page(or whatever) and not to stay at CAS logout page. - John Smith
Can't you just use http://localhost:8080/myApp as logout-success-url? - Aleksandr M
nope, because in this case user is not actually logged out - John Smith

2 Answers

6
votes

Does this helps from default cas-servlet.xml

 <bean id="logoutController" class="org.jasig.cas.web.LogoutController"
    p:centralAuthenticationService-ref="centralAuthenticationService"
    p:logoutView="casLogoutView"
    p:warnCookieGenerator-ref="warnCookieGenerator"
    p:ticketGrantingTicketCookieGenerator-ref="ticketGrantingTicketCookieGenerator"
    p:servicesManager-ref="servicesManager"
    p:followServiceRedirects="${cas.logout.followServiceRedirects:false}"/>

Look at last line ${cas.logout.followServiceRedirects:false}.

-1
votes

cas-servlet.xml

  <bean id="logoutController" class="org.jasig.cas.web.LogoutController"
        p:centralAuthenticationService-ref="centralAuthenticationService"
        p:logoutView="casLogoutView"
        p:warnCookieGenerator-ref="warnCookieGenerator"
        p:ticketGrantingTicketCookieGenerator-ref="ticketGrantingTicketCookieGenerator"
        p:servicesManager-ref="servicesManager"
        p:followServiceRedirects="${cas.logout.followServiceRedirects:true}"/>

In logout url

<a href="/cas/logout?service=http://localhost:8080/myApp" title="Log Out">Logout</a>