轻松搭建CAS 5.x系列(9)-登录后显示通知信息

概述说明


用户在账号名密码认证通过后,CAS可以跳转到登陆完成页面前,显示相关的通知页面。

搭建步骤


`1. 首先,您需要有个CAS Server端

如果您没有,可以按照我之前写的文章《轻松搭建CAS 5.x系列文章》系列的前3篇文章搭建好CAS Server。

 

`2. 在pom.xml增加依赖包

1         <!-- Authentication Interrupt Begin -->     
2         <dependency>
3           <groupId>org.apereo.cas</groupId>
4           <artifactId>cas-server-support-interrupt-webflow</artifactId>
5           <version>${cas.version}</version>
6         </dependency>
7         <!-- Authentication Interrupt End -->  

 

-3. 编写中断的配置文件

D:\casoverlay\cas-overlay-template\src\main\resources\interrupt.json

{
  "admin" : {
    "message" : "Announcement message <strong>goes here</strong>.",
    "links" : {
      "Go to Location1" : "https://www.location1.com",
      "Go to Location2" : "https://www.location2.com"
    },
    "block" : false,
    "ssoEnabled" : false,
    "interrupt" : true,
    "autoRedirect" : false,
    "autoRedirectAfterSeconds" : -1
  }
}

 

`4. application.properties增加配置文件

1 cas.interrupt.json.location=classpath:/interrupt.json

 

-5. OK,可以打包了

1 mvn package

 

-6. 打包后打target\cas.war部署到tomcat

 

搭建OK了,我们来验证下功能

 

功能演示


启动tomcat,看下效果

 

参考文章


1.CAS中文文档站点#notifications

最后,大家想更多CAS了解的话,可以来CAS中文文档站点(http://www.cassso-china.cn)来瞅瞅

 

猜你喜欢

转载自www.cnblogs.com/jpeanut/p/9463003.html
今日推荐