User Logout

when implementing jasig-CAS, I ran into the following problem: I want to implement logout. At the moment it works fine, but I want the CAS server to redirect the user after reaching the server where the request came from (for example, http://localhost:8080/myApp ). I tried to add a β€œservice” in the security context, but nothing happened here is part 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.

+4
source share
2 answers

Does this help by 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 the last line of ${cas.logout.followServiceRedirects:false} .

+6
source

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> 
-1
source

Source: https://habr.com/ru/post/1438619/


All Articles