---恢复内容开始---

github repository:  apereo/cas

一,获取项目

链接:https://github.com/apereo/cas-overlay-template

  • clone该项目。
  • 切换到5.3分支。
  • 安装maven依赖

二,overlay 配置文件

build 项目包 (注意:windows 下使用 build.cmd) 

./build.sh package

  

此时 build/cas-resources 文件夹内找到,以下两个文件 (不同的cas overlay版本,位置可能不同,根据你的实际情况,找到以下两个文件)

services/

application.properties

将其复制到当前项目的,resources下。

刚新建的项目,需要自己创建 src/main/resources     , 此时你的application.properties将会覆盖默认的application.properties来使用。

注意:

    你也可以按照,官方说明中的,使用 build.sh copy 命令,将配置文件拷贝到 /etc/cas/config 中(先自己创建/etc/cas 文件夹),然后编辑 cas.properties。其配置方式和通过application.properties配置一致。

三,设置秘钥

手动指定服务器秘钥。

The CAS server uses a ticket granting cookie in the browser to maintain login state during single sign-on sessions. A client can present this cookie to CAS in lieu of primary credentials and, provided it is valid, will be authenticated. The contents of the cookie should be encrypted to protect them, and when running in a multi-node environment, all of the nodes must use the same keys. Add the following lines to etc/cas/config/cas.properties:

cas.tgc.secure=true
cas.tgc.crypto.signing.key=
cas.tgc.crypto.encryption.key=

  

Now visit the JSON Web Key Generator and click on the “Shared Secret” tab. Enter 512 into the “Key Size” field, select HS256 from the “Algorithm” drop-down, and click the “New Key” button. Copy the value of the k parameter from the “Key” dialog box and enter it as the value for the cas.tgc.crypto.signing.key property.

Then enter 256 into the “Key Size” field, select HS256 from the “Algorithm” drop-down, and click “New Key” again, and enter that value for the cas.tgc.crypto.encryption.key property. When finished, you should have something like this:

cas.tgc.secure=true
cas.tgc.crypto.signing.key=bMpP_eHgIsL1kz_cnxEqYo9Bb384V70eZIvWctQ5V6xTO4P6wsQjFlglD9OSQNlFdb0mT2Q1E3qXdo05_tzrjQ
cas.tgc.crypto.encryption.key=r88iOMdbRMLOkITV54kax4WgadTdzUYSBXNhOp_oqS0

  

 CAS uses Spring Webflow to manage the authentication sequence, and this also needs to be encrypted. Add the following lines to application.properties

cas.webflow.crypto.signing.key=
cas.webflow.crypto.encryption.key=

Using the JSON Web Key Generator again (see above), generate an HS256 key of size 512 and enter it for the value of the cas.webflow.crypto.signing.key property.

Unlike the ticket granting cookie encryption key above, the encryption key for Spring WebFlow is not a JSON Web Key. Rather, it’s a randomly-generated string of 16 (by default) octets, Base64-encoded. An easy way to generate this key is to use openssl:

casdev-master# openssl rand -base64 16
Kmj1JJSPOTSiagI4gCxhUA==
casdev-master#

Enter the output from the openssl command for the value of the cas.webflow.crypto.encryption.key property. When finished, you should have something like this:

cas.webflow.crypto.signing.key=      hGapVlP6pCzIUo_CCboRszQpvWFPazmyuWsBUOoWYqUQqMKw55al5c_EGH6VBtjpIVUqEAXcvLQjQ8HaVBEmDw
cas.webflow.crypto.encryption.key= Kmj1JJSPOTSiagI4gCxhUA==

  

四,运行服务器

./build.sh run

登录

http://localhost:8443/login

application.properties 中有管理员账号密码(   [账号]:[密码] ):

cas.authn.accept.users=casuser::Mellon

apereo cas 小记01--服务器搭建01的更多相关文章

  1. CAS单点登录服务器搭建

    关于cas单点登录的原理及介绍这里不做说明了,直接开始: 1.war包下载 去官网(https://www.apereo.org/projects/cas/download-cas)下载cas_ser ...

  2. CAS 5.3服务器搭建

    一.本例环境说明 JDK 1.8 CAS 5.3 apache-maven-3.6.0 二.CAS安装步骤 2.1 提前安装好JDK和Maven环境 安装步骤略 2.2 CAS环境搭建 2.2.1 C ...

  3. Apereo CAS Server服务端搭建教程

    不说废话了,直接看搭建过程吧. 首先到下载源码,https://github.com/apereo/cas-overlay-template/tree/4.2 附上地址,本次版本为4.2,下载源码后如 ...

  4. cas服务器搭建

    一.CAS是Central Authentication Service的缩写,中央认证服务,一种独立开放指令协议.CAS 是 Yale 大学发起的一个开源项目,旨在为 Web 应用系统提供一种可靠的 ...

  5. cas 3.5.3服务器搭建+spring boot集成+shiro模拟登录(不修改现有shiro认证架构)

    因为现有系统外部接入需要,需要支持三方单点登录.由于系统本身已经是微服务架构,由多个业务独立的子系统组成,所以有自己的用户认证微服务(不是cas,我们基础设施已经够多了,现在能不增加就不增加).但是因 ...

  6. CAS5.3服务器搭建及SpringBoot整合CAS实现单点登录

    1.1 什么是单点登录 单点登录(Single Sign On),简称为 SSO,是目前比较流行的企业业务整合的解决方案之一.SSO的定义是在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的 ...

  7. maven实战(01)_搭建开发环境

    一 下载maven 在maven官网上可下载maven:http://maven.apache.org/download.cgi 下载好后,解压.我的解压到了:D:\maven\apache-mave ...

  8. 搭建CAS单点登录服务器

    最近公司的一个项目需要用到单点登录的功能,之前对单点登录了解得不多.于是网上找了下单点登录的解决方案,发现CAS是个不错的解决方案.于是搭个环境测试了一下.这里记录下测试的详细步骤. 官网:http: ...

  9. spring原理案例-基本项目搭建 01 spring framework 下载 官网下载spring jar包

    下载spring http://spring.io/ 最重要是在特征下面的这段话,需要注意: All avaible features and modules are described in the ...

随机推荐

  1. unittest模块使用方法

    unittest模块常用属性 1. unittest.TestCase类:所有的测试用例类继承的基类 定义一个测试用例类,需要继承TestCase,比如: class BaiduTest(unitte ...

  2. LeetCode动画 | 1038. 从二叉搜索树到更大和树

    今天分享一个LeetCode题,题号是1038,标题是:从二分搜索树到更大和数. 题目描述 给出二叉搜索树的根节点,该二叉树的节点值各不相同,修改二叉树,使每个节点 node 的新值等于原树中大于或等 ...

  3. [bzoj4823][洛谷P3756][Cqoi2017]老C的方块

    Description 老 C 是个程序员. 作为一个懒惰的程序员,老 C 经常在电脑上玩方块游戏消磨时间.游戏被限定在一个由小方格排成的R行C列网格上 ,如果两个小方格有公共的边,就称它们是相邻的, ...

  4. .netcore 3.1高性能微服务架构:webapi规范

    1.1 定义 1.基础接口:单一职责原则,每个接口只负责各自的业务,下接db,通用性强. 2.聚合接口:根据调用方需求聚合基础接口数据,业务性强. 1.2 协议 1. 客户端在通过 API 与后端服务 ...

  5. Java反射的常见用法

    反射的常见用法有三类,第一类是“查看”,比如输入某个类的属性方法等信息,第二类是“装载“,比如装载指定的类到内存里,第三类是“调用”,比如通过传入参数,调用指定的方法. 1 查看属性的修饰符.类型和名 ...

  6. jmeter连接数据库操作

    JDBC Connection Configuration 数据库连接配置 数据库连接配置器,用来连接数据库,是一个连接池. 界面介绍 1.右键线程组->添加->配置元件->JDBC ...

  7. 笔记常用Linux命令(二) 进程和端口

    查看系统进程 ps:用于报告当前系统的进程状态 a:显示所有终端机下执行的程序 ps -ef/ps aux: 这两个命令都是查看当前系统正在运行进程,两者的区别是展示格式不同. 如果想要查看特定的进程 ...

  8. shiro中ecache-core版本引起的异常

    ecache-core包版本不对引起的错误,将2.5.3换成2.4.5就好了 来源 WARN [RMI TCP Connection(3)-127.0.0.1] - Exception encount ...

  9. Kubernetes学习(二)

    二 POD生命周期 initC作用说明 initC举例说明 init-pod.yaml apiVersion: v1kind: Podmetadata: name: myapp-pod labels: ...

  10. 不停机替换线上代码? 你没听错,Arthas它能做到

    写在前边 有没有这样一种感受,自己写的代码在开发.测试环境跑的稳得一笔,可一到线上就抽风,不是缺这个就是少那个反正就是一顿报错,线上调试代码又很麻烦,让人头疼得很.阿里巴巴出了一款名叫Arthas的工 ...