I'm trying singleLogout from Spring boot application using CAS server.I'm able to logout from Spring application and CAS server but I want to redirect to my custom logout page of spring application https://applicationip:port/application/logoutsuccesspage rather than CAS logout page i.e. https://casserverip:port/cas/logout
问题:
回答1:
Documentation is your friend.
Quoting from official docs:
Per the CAS Protocol, the /logout endpoint is responsible for destroying the current SSO session. Upon logout, it may also be desirable to redirect back to a service. This is controlled via specifying the redirect link via the service parameter. The specified service must be registered in the service registry of CAS and enabled and CAS must be allowed to follow service redirects.
and related application properties:
# cas.logout.followServiceRedirects=false
# cas.logout.redirectParameter=service
# cas.logout.redirectUrl=https://www.github.com
# cas.logout.confirmLogout=false
# cas.logout.removeDescendantTickets=false
So first, you have to instruct cas to follow logout redirects by setting:
cas.logout.followServiceRedirects=true
and then provide the url that you wish to redirect users after logout:
cas.logout.redirectUrl=https://applicationip:port/application/logoutsuccesspage
References: Logout - Single Logout & CAS Properties
Note: Docs refer to 5.3.x branch.