cas 配置相关

2023-05-16

默认配置


##
# CAS Cloud Bus Configuration
#
spring.cloud.bus.enabled=false

# Indicates that systemPropertiesOverride can be used.
# Set to false to prevent users from changing the default accidentally. Default true.
spring.cloud.config.allow-override=true

# External properties should override system properties.
spring.cloud.config.override-system-properties=false

# When allowOverride is true, external properties should take lowest priority, and not override any
# existing property sources (including local config files).
spring.cloud.config.override-none=false

# spring.cloud.bus.refresh.enabled=true
# spring.cloud.bus.env.enabled=true
# spring.cloud.bus.destination=CasCloudBus
# spring.cloud.bus.ack.enabled=true

endpoints.enabled=false
endpoints.sensitive=true

endpoints.restart.enabled=false
endpoints.shutdown.enabled=false

# Control the security of the management/actuator endpoints
# The 'enabled' flag below here controls the rendering of details for the health endpoint amongst other things.
management.security.enabled=true
management.security.roles=ACTUATOR,ADMIN
management.security.sessions=if_required
management.context-path=/status
management.add-application-context-header=false

# Define a CAS-specific "WARN" status code and its order
management.health.status.order=WARN, DOWN, OUT_OF_SERVICE, UNKNOWN, UP

# Control the security of the management/actuator endpoints
# With basic authentication, assuming Spring Security and/or relevant modules are on the classpath.
security.basic.authorize-mode=role
security.basic.path=/cas/status/**
# security.basic.enabled=true
# security.user.name=casuser
# security.user.password=

##
# CAS Web Application Session Configuration
#
server.session.timeout=300
server.session.cookie.http-only=true
server.session.tracking-modes=COOKIE

##
# CAS Thymeleaf View Configuration
#
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.cache=true
spring.thymeleaf.mode=HTML
spring.thymeleaf.template-resolver-order=100
##
# CAS Log4j Configuration
#
# logging.config=file:/etc/cas/log4j2.xml
server.context-parameters.isLog4jAutoInitializationDisabled=true

##
# CAS AspectJ Configuration
#
spring.aop.auto=true
spring.aop.proxy-target-class=true

##
# CAS Authentication Credentials
#
#cas.authn.accept.users=duanyiming::duanyiming

数据库验证配置

数据库验证账号密码

pom依赖
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-jdbc</artifactId>
    <version>${cas.version}</version>
</dependency>
<dependency>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-server-support-jdbc-drivers</artifactId>
    <version>${cas.version}</version>
</dependency>
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.36</version>
</dependency>
数据库语句
#表结构使用的是之前shiro用户表
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
  `uid` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(50) DEFAULT '' COMMENT '用户名',
  `password` varchar(256) DEFAULT NULL COMMENT '登录密码',
  `name` varchar(256) DEFAULT NULL COMMENT '用户真实姓名',
  `id_card_num` varchar(256) DEFAULT NULL COMMENT '用户身份证号',
  `state` char(1) DEFAULT '0' COMMENT '用户状态:0:正常状态,1:用户被锁定',
  PRIMARY KEY (`uid`),
  UNIQUE KEY `username` (`username`) USING BTREE,
  UNIQUE KEY `id_card_num` (`id_card_num`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
#插入用户信息表
INSERT INTO user_info(uid,username,`password`,`name`,id_card_num) VALUES (null,'admin','123456','张飞','');

#
#添加jdbc认证
cas.authn.jdbc.query[0].sql=SELECT * FROM user_info WHERE username =?
#那一个字段作为密码字段
cas.authn.jdbc.query[0].fieldPassword=password
#配置数据库连接
cas.authn.jdbc.query[0].url=jdbc:mysql://127.0.0.1:3306/testshiro?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
cas.authn.jdbc.query[0].dialect=org.hibernate.dialect.MySQLDialect
#数据库用户名
cas.authn.jdbc.query[0].user=root
#数据库密码
cas.authn.jdbc.query[0].password=123456
#mysql驱动
cas.authn.jdbc.query[0].driverClass=com.mysql.jdbc.Driver
#
添加MD5加密配置

如果两种方式都配置的话,默认先用普通MD5验证,如果验证失败,打印异常日志,然后再使用加盐方式验证。

##配置加密策略
cas.authn.jdbc.query[0].passwordEncoder.type=DEFAULT
cas.authn.jdbc.query[0].passwordEncoder.characterEncoding=UTF-8
cas.authn.jdbc.query[0].passwordEncoder.encodingAlgorithm=MD5
#
对密码进行盐值处理
##加密迭代次数
#cas.authn.jdbc.encode[0].numberOfIterations=2
##该列名的值可替代上面的值,但对密码加密时必须取该值进行处理
cas.authn.jdbc.encode[0].numberOfIterationsFieldName=
##盐值固定列
cas.authn.jdbc.encode[0].saltFieldName=username
##静态盐值
cas.authn.jdbc.encode[0].staticSalt=.
cas.authn.jdbc.encode[0].sql=SELECT * FROM user_info WHERE username =?
##对处理盐值后的算法
cas.authn.jdbc.encode[0].algorithmName=MD5
cas.authn.jdbc.encode[0].passwordFieldName=password
cas.authn.jdbc.encode[0].expiredFieldName=expired
cas.authn.jdbc.encode[0].disabledFieldName=disabled
##数据库连接
cas.authn.jdbc.encode[0].url=jdbc:mysql://39.99.234.10:3306/cas-uac?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
cas.authn.jdbc.encode[0].dialect=org.hibernate.dialect.MySQL5Dialect
cas.authn.jdbc.encode[0].driverClass=com.mysql.jdbc.Driver
cas.authn.jdbc.encode[0].user=cas-uac
cas.authn.jdbc.encode[0].password=ehC5SNnpSnKccR4X

登出配置

#配置允许登出后跳转到指定页面
cas.logout.followServiceRedirects=true
#跳转到指定页面需要的参数名为 service
cas.logout.redirectParameter=service
#在退出时是否需要 确认一下  true确认 false直接退出
cas.logout.confirmLogout=true
#是否移除子系统的票据
cas.logout.removeDescendantTickets=true
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

cas 配置相关 的相关文章

随机推荐

  • ZED2i相机在ROS2上运行vins排坑与用docker运行Kalibr标定ZED2i相机

    按照ZED官网提供的方式ZED2i的SDK和ros2 wrapper之后 还有很多工作要做才能让ZED成功运行稳定的VINS 1 ZED2i用Kalibr标定IMU和相机 由于我的电脑怎么装Kalibr都装不上 说是啥boost这个库版本不
  • 解决MobaXterm无法连接虚拟机问题总结

    一 说明 ubuntu拒绝root ssh远程登录通常情况是ssh设置了禁止root远程登录 xff0c 解决办法就是 xff1a 修改ssh配置 xff0c 然后重启ssh服务即可 二 检查是否安装ssh远程登陆模块 命令 xff1a s
  • 安装spinningup填坑ERROR: Could not build wheels for mpi4py which use PEP 517

    深度强化学习教程 xff1a Spinning Up项目中文版 Spinning Up 文档 ERROR Failed building wheel for mpi4py Failed to build mpi4py ERROR Could
  • MarkDown插入图片调整大小

    一定要注意修改格式的时候要加空格 xff0c 例如 Alt https avatar csdn net 7 7 B 1 ralf hx163com jpg 61 100x jpg和 61 之间的空格不能没有 具体参照 xff1a https
  • Linux初学记录

    编写一个名为iffile程序 xff0c 它执行时判断 bin目录下date文件是否存在 xff1f bin bash fname 61 bin date if test f fname then echo exist fi 123456
  • tensorflow的奇妙下划线,形如(_,变量)变量命名操作的解释

    问题的发现 今天在尝试实现 深度学习之TensorFlow入门 原理与进阶实战 的时候书写了一段代码 xff0c 其中有一行代码我甚是纠结了半天 xff0c 代码如下 xff1a span class token punctuation s
  • zynq实现视频动态字符叠加OSD,提供2套工程源码和技术支持

    目录 1 网上同行的OSD方案 太low 2 本方案OSD的优势3 HLS实现方案4 OSD延时和资源占用情况5 工程1 xff1a zynq7100实现字符叠加6 上板调试验证7 福利 xff1a 工程源码获取 1 网上同行的OSD方案
  • 向日葵连接已断开的解决办法

    方法一 打开ubuntu系统的终端 xff0c 依次输入如下命令 xff1a sudo apt get update sudo apt get upgrade sudo apt install lightdm 重启电脑 方法二 xff08
  • UDP传输图片(分包)

    前提 xff1a 需要了解QUdp的简单通信 xff0c 比如收发个字符串 QP ixmap图片类 xff0c 以此类来加载图片 Q B uffer和Q B yteArray来记录数据 memcpy函数的用法 分包概念 xff1a 举个例子
  • 结构型设计模式(七种)

    3 结构型设计模式 结构型模式描述如何将类或对象按某种布局组成更大的结构 它分为类结构型模式和对象结构型模式 xff0c 前者采用继承机制来组织接口和类 xff0c 后者采用组合或聚合组合对象 由于组合关系或聚合关系比较继承关系耦合度低 x
  • IDEA+Log4j2 设置控制台打印彩色日志

    在Log4j 2 10以前的版本 xff0c pattern中配置 highlight属性是可以正常打印彩色日志的 例如 xff1a pattern 34 d yyyy MM dd HH mm ss SSS highlight 5level
  • weex打包安卓艰苦之路

    weex打包安卓 一 配置安卓环境 下载安卓SDK配置ANDROID HOME配置 ANDROID HOME tools android h 检查是否配置成功 二 weex的安装使用 一 weex简介以及开发前提 1 简介 官网的解释为We
  • docker命令

    Docker命令详解 语法 docker run OPTIONS IMAGE COMMAND ARG Usage Run a command in a new container 中文意思为 xff1a 通过run命令创建一个新的容器 xf
  • PX4 mixer load

    mixer load dev pwm output0 fs microsd mixer ttt mix 启动一个自定义的mixer 系统默认从 etc mixers加载mixer 如果在 fs microsd etc mixers有相同名称
  • Bean三级缓存

    一 核心步骤 提前引用进行动态代理 后置处理器进行动态代理 二 具体步骤 1 获取bean AbstractBeanFactory doGetBean 2 第一次去单例池查询bean 最终调用 xff1a DefaultSingletonB
  • MinIO Client客户端使用

    安装 文档地址 xff1a https docs min io 基本上MinIO服务器和客户端支持在很多系统上安装 xff0c 比如Windows macOS等 xff0c 这里主要说Linux系统 minio安装 span class t
  • Security+Thymeleaf整合

    文章目录 1 版本介绍2 演示demo3 常见使用表达式Using the expression utility objectsUsing the attributes 官方地址 1 版本介绍 2 演示demo html界面 span cl
  • java正则的使用

    java util regex是一个用正则表达式所订制的模式来对字符串进行匹配工作的类库包 它包括两个类 xff1a Pattern和Matcher Pattern 一个Pattern是一个正则表达式经编译后的表现模式 Matcher 一个
  • cas服务端动态servers

    一 什么是servers cas的分为服务端和客户端 xff0c 如果客户端要使用cas需要把自己的域名或ip注册到cas服务端才可以使用 默认的servers为静态的 src main resources services HTTPSan
  • cas 配置相关

    默认配置 span class token comment span span class token comment CAS Cloud Bus Configuration span span class token comment sp