CAS single sign-on service side of deployment

A, CAS server set up

1.1 CAS support Http login configuration

CAS default is to log on to https link, but if learning is to remove restrictions https, this blog is based on the introduction of Cas4.2.7, turn over before 4.0, as detailed in https://blog.csdn.net/u014427391 / article / details / 82083995

Modify Cas4.2.7 and 4.0 are not the same, Cas4.2.7 needs its own version of the compiler, Gradle is based, not based on Maven, and do not bother to download 4.0, because version 4.0 has provided war package, do not need to compile your own, below introduce version 4.2.7, how to support http Login

Cas4.2.7 need to modify the cas-server-webapp / WEB-INF / cas.properties, changed all non-secure

tgc.secure=false
warn.cookie.secure=false

cas-server-webapp / resources / service / HTTPSandIMAPS-10000001.json original

"serviceId" : "^(https|imaps)://.*"

With http

"serviceId" : "^(https|imaps|http)://.*"

Note whether the cas-server-webapp / WEB-INF / view / jsp / default / ui / casLoginView.jsp label block is a parity page HTTPS protocol

<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>

Then there is no sign in the non-safety tips

1.2 CAS server deployment running

Then throw in the war package Tomcat's webapp, the deployment starts, the default account password casuser / Mellon, cas4.2.7 account password is written in cas.properties inside, and this is not the same 4.0

accept.authn.users=casuser::Mellon

sign in

Login is successful, of course, in the project, certainly can not do that, we need this permission to add or configure jdbc check and so
Here Insert Picture Description
a single point out, the link is http://127.0.0.1:8080/cas/logout
Here Insert Picture Description

1.3 supports Chinese login screen

Modify them to find the WEB-INF modify the following cas.properties

##
# CAS Internationalization
#
 locale.default=zh_CN
 locale.param.name=locale
 message.bundle.encoding=UTF-8
 message.bundle.cacheseconds=180
 message.bundle.fallback.systemlocale=false
 message.bundle.usecode.message=true
 message.bundle.basenames=classpath:custom_messages,classpath:messages

Guess you like

Origin www.cnblogs.com/mzq123/p/10990993.html