Unable to redirect to Spring application page after logout from CAS Server

ε祈祈猫儿з 提交于 2019-12-25 00:29:57

问题


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.



来源:https://stackoverflow.com/questions/55529015/unable-to-redirect-to-spring-application-page-after-logout-from-cas-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!