2、cas4.2.x修改支持http协议,自定义登陆页面|8月更文挑战

这是我参与8月更文挑战的第6天,活动详情查看:8月更文挑战css

1、cas4.2.x修改支持http协议

 cas4.2以上的代码作了一些框架的优化,4.2如下的版本的不少配置都是写在xml文件中。4.2以上统一提取到了cas.properties文件中,因此在去掉https的时候 方式也有所变化。html

也可参照官网文档:apereo.github.io/cas/4.2.x/i…git

进入tomcat中能够看到:github

决定是否须要在安全链接(https)的状况下才能建立tgc和warn.cookie,只要把tgc.secure和warn.cookie.secure这两个属性修改为false便可。spring

进入cas.properties修改json

还有一个地方须要修改,不然会报Application Not Authorized to Use CAStomcat

修改  HTTPSandIMAPS-10000001.json文件中 "^(https|imaps)://."为"^(https|imaps|http)://.",  安全

配置完http方式访问以后页面上的 提示仍是存在的,若是须要把它去掉的话,cas统一认证的登录页面位于:cas目录/WEB-INF/view/jsp/default 文件夹里,其中ui/casLoginView.jsp为登录页面。咱们找到这段代码删掉便可。markdown

<%--
<c:if test="${not pageContext.request.secure}">     <div id="msg" class="errors">         <h2><spring:message code="screen.nonsecure.title" /></h2>         <p><spring:message code="screen.nonsecure.message" /></p>     </div> </c:if>
--%>
复制代码

2、cas4.2.x 自定义登陆页面

官方文档:https://apereo.github.io/cas/4.2.x/installation/User-Interface-Customization.htmlcookie

效果图:

水平有限,弄不出特别好看的页面,凑合看吧,根据官方文档,首先上传你的css

我是在源码中修改的,你要作好备份奥!

在WEB-INF/classes/cas-theme-default.properties添加样式

修改登陆页面:按照我的需求修改

登陆页面就已经修改完毕了

相关文章
相关标签/搜索