cas 4.2.1
来源:互联网 发布:马小丝的淘宝 编辑:程序博客网 时间:2024/05/20 15:58
1、加入cas-server-support-jdbc 引用,配置数据库连接 QueryDatabaseAuthenticationHandler
2、配置数据库看连接池 cas-server-webapp 下的 cas.properties
# == Basic database connection pool configuration ==database.driverClass=com.mysql.jdbc.Driverdatabase.url=jdbc:mysql://127.0.0.1:3306/admin?useUnicode=true&characterEncoding=utf8database.user=rootdatabase.password=123456database.pool.minSize=6database.pool.maxSize=18# Maximum amount of time to wait in ms for a connection to become# available when the pool is exhausteddatabase.pool.maxWait=10000# Amount of time in seconds after which idle connections# in excess of minimum size are pruned.database.pool.maxIdleTime=120# Number of connections to obtain on pool exhaustion condition.# The maximum pool size is always respected when acquiring# new connections.database.pool.acquireIncrement=6# == Connection testing settings ==# Period in s at which a health query will be issued on idle# connections to determine connection liveliness.database.pool.idleConnectionTestPeriod=30# Query executed periodically to test healthdatabase.pool.connectionHealthQuery=select 1# == Database recovery settings ==# Number of times to retry acquiring a _new_ connection# when an error is encountered during acquisition.database.pool.acquireRetryAttempts=5# Amount of time in ms to wait between successive aquire retry attempts.database.pool.acquireRetryDelay=2000
deployConfigContext.xml
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" p:driverClass="${database.driverClass}" p:jdbcUrl="${database.url}" p:user="${database.user}" p:password="${database.password}" p:initialPoolSize="${database.pool.minSize}" p:minPoolSize="${database.pool.minSize}" p:maxPoolSize="${database.pool.maxSize}" p:maxIdleTimeExcessConnections="${database.pool.maxIdleTime}" p:checkoutTimeout="${database.pool.maxWait}" p:acquireIncrement="${database.pool.acquireIncrement}" p:acquireRetryAttempts="${database.pool.acquireRetryAttempts}" p:acquireRetryDelay="${database.pool.acquireRetryDelay}" p:idleConnectionTestPeriod="${database.pool.idleConnectionTestPeriod}" p:preferredTestQuery="${database.pool.connectionHealthQuery}" />
可以自定义 druid
加入配置
<alias name="queryDatabaseAuthenticationHandler" alias="primaryAuthenticationHandler" /><alias name="dataSource" alias="queryDatabaseDataSource" /><alias name="dataSource" alias="queryEncodeDatabaseDataSource" />注释掉
<util:map id="authenticationHandlersResolvers"> <entry key-ref="proxyAuthenticationHandler" value-ref="proxyPrincipalResolver" /> <entry key-ref="primaryAuthenticationHandler" value-ref="primaryPrincipalResolver" /> <!--<entry key-ref="primaryDatabaseAuthenticationHandler" value-ref="primaryPrincipalResolver" />--></util:map>
<!--<alias name="acceptUsersAuthenticationHandler" alias="primaryAuthenticationHandler" />-->
3、数据库查询用户密码
cas.jdbc.authn.query.sql=select password from users where username=?
4、安全验证
# Decides whether SSO cookie should be created only under secure connections. default truetgc.secure=false# The expiration value of the SSO cookietgc.maxAge=-1# The name of the SSO cookietgc.name=TGC# The path to which the SSO cookie will be scopedtgc.path=/cas# The expiration value of the SSO cookie for long-term authenticationstgc.remember.me.maxAge=1209600# Decides whether SSO Warning cookie should be created only under secure connections.warn.cookie.secure=false# The expiration value of the SSO Warning cookiewarn.cookie.maxAge=-1# The name of the SSO Warning cookiewarn.cookie.name=CASPRIVACY# The path to which the SSO Warning cookie will be scopedwarn.cookie.path=/cas5、最后设置 访问请求 http支持
resources/services/HTTPSandIMAPS-10000001.json
"serviceId" : "^(https|imaps|http)://.*",加入http支持
0 0
- cas 4.2.1
- sso 单点登录cas使用(1): cas 4.2.7 maven cas-overlay部署服务端
- CAS(1)-简介
- CAS(1)-简介
- CAS
- CAS
- CAS
- cas
- CAS
- cas
- CAS
- cas
- cas
- CAS
- CAS
- CAS
- cas
- CAS
- 【面包屑】快速使用RecyclerView搭建列表
- mysql数据库启动的时候报错服务启动失败
- 图像处理入门教程(转)
- Oracle Form Builder问题集锦(第一弹:连接报错:ORA-12154:TNS:无法解析指定的连接标识符)
- 选择排序
- cas 4.2.1
- 请设计输出实数的格式,包括:⑴一行输出一个实数;⑵一行内输出两个实数;⑶一行内输出三个实数。实数用"6.2f"格式输出。
- Hibernate之旅二:Hibernate简介
- 《ACM程序设计》书中题目 R
- 测试基础---测试策略与方法01
- Unity3D说明文档翻译-The Game View
- 三角形内部线性插值方法
- Django Filter get
- leetcode 141. Linked List Cycle