Apereo CAS 5.0.X中默认提供了以下集中service信息存储方式。
- CouchbaseServiceRegistryDao
- InMemoryServiceRegistryDaoImpl
- JpaServiceRegistryDaoImpl
- LdapServiceRegistryDao
- MongoServiceRegistryDao
- EmbeddedServiceRegistryDao
- JsonServiceRegistryDao
- YamlServiceRegistryDao
JpaServiceRegistryDaoImpl
参考文档:https://apereo.github.io/cas/5.0.x/installation/JPA-Service-Management.html
重新编译打包
使用JpaServiceRegistryDaoImpl需要引入cas-server-support-jpa-service-registry,然后在application.properties配置文件中进行相关的配置就行了。
配置application.properties
# cas.serviceRegistry.jpa.healthQuery=SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
# cas.serviceRegistry.jpa.isolateInternalQueries=false
# cas.serviceRegistry.jpa.url=jdbc:hsqldb:mem:cas-service-registry
# cas.serviceRegistry.jpa.failFast=true
# cas.serviceRegistry.jpa.dialect=org.hibernate.dialect.HSQLDialect
# cas.serviceRegistry.jpa.leakThreshold=10
# cas.serviceRegistry.jpa.batchSize=1
# cas.serviceRegistry.jpa.defaultCatalog=
# cas.serviceRegistry.jpa.defaultSchema=
# cas.serviceRegistry.jpa.user=sa
# cas.serviceRegistry.jpa.ddlAuto=create-drop
# cas.serviceRegistry.jpa.password=
# cas.serviceRegistry.jpa.autocommit=false
# cas.serviceRegistry.jpa.driverClass=org.hsqldb.jdbcDriver
# cas.serviceRegistry.jpa.idleTimeout=5000
# cas.serviceRegistry.jpa.pool.suspension=false
# cas.serviceRegistry.jpa.pool.minSize=6
# cas.serviceRegistry.jpa.pool.maxSize=18
# cas.serviceRegistry.jpa.pool.maxIdleTime=1000
# cas.serviceRegistry.jpa.pool.maxWait=2000
配置好了之后,重启tomcat,hibernate会自动在指定的数据库里创建3个跟service registry相关的表:RegexRegisteredService、RegexRegisteredServiceProperty和RegisteredServiceImpl_Props。
JSON Service Registry
参考文档:https://apereo.github.io/cas/5.0.x/installation/JSON-Service-Management.html