cas4.2以上的代码做了一些框架的优化,4.2以下的版本的很多配置都是写在xml文件中。4.2以上统一提取到了cas.properties文件中,所以在去掉https的时候 方式也有所变化。
也可参照官网文档:https://apereo.github.io/cas/4.2.x/installation/Configuring-SSO-Session-Cookie.html
进入tomcat中可以看到:
决定是否需要在安全连接(https)的情况下才能创建tgc和warn.cookie,只要把tgc.secure和warn.cookie.secure这两个属性修改成false即可。
进入cas.properties修改
还有一个地方需要修改,否则会报Application Not Authorized to Use CAS
修改 HTTPSandIMAPS-10000001.json文件中 "^(https|imaps)://.*"为"^(https|imaps|http)://.*",
配置完http方式访问之后页面上的 提示还是存在的,如果需要把它去掉的话,cas统一认证的登陆页面位于:cas目录/WEB-INF/view/jsp/default 文件夹里,其中ui/casLoginView.jsp为登陆页面。我们找到这段代码删掉即可。
<%--
<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>
--%>