单点登录(六)cas改造——退出到指定页面

本文介绍了CAS单点登录系统中如何实现退出时跳转到自定义页面。通过修改`cas-servlet.xml`配置文件,设置`logoutController`的`followServiceRedirects`属性为`true`,并配置客户端退出链接,可以实现用户退出后重定向到指定URL。测试结果显示,从任一受保护应用退出后,所有其他应用都会进行单点退出,验证了配置的有效性。

CAS退出默认是转向CAS内置的退出页面,在实际应用中需要跳转到自己指定的页面。退出转向决定于org.jasig.cas.web.LogoutController,我们看一下原代码。

protected ModelAndView handleRequestInternal(
        final HttpServletRequest request, final HttpServletResponse response)
        throws Exception {
        final String ticketGrantingTicketId = this.ticketGrantingTicketCookieGenerator.retrieveCookieValue(request);
        final String service = request.getParameter("service");

        if (ticketGrantingTicketId != null) {
        	System.out.println("在centralAuthenticationService中销毁  ");
        	this.centralAuthenticationService
                .destroyTicketGrantingTicket(ticketGrantingTicketId);
            
            this.ticketGrantingTicketCookieGenerator.removeCookie(response);
            this.warnCookieGenerator.removeCookie(response);
        }

        if (this.followServiceRedirects && 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值