PageRenderTime 175ms CodeModel.GetById 33ms RepoModel.GetById 5ms app.codeStats 0ms

/docs/cas-server-documentation/configuration/Configuration-Properties-Common.md

https://github.com/frett/cas
Markdown | 1112 lines | 860 code | 252 blank | 0 comment | 0 complexity | 90b2ccb23a4946294973fe63f634032b MD5 | raw file
  1. ---
  2. layout: default
  3. title: CAS Common Properties Overview
  4. category: Configuration
  5. ---
  6. # CAS Common Properties
  7. This document describes a number of suggestions and configuration options that apply to and are common amongst a selection of CAS modules and features.
  8. To see the full list of CAS properties, please [review this guide](Configuration-Properties.html).
  9. ## Naming Convention
  10. - Settings and properties that are controlled by the CAS platform directly always begin with the prefix `cas`. All other settings are controlled
  11. and provided to CAS via other underlying frameworks and may have their own schemas and syntax. **BE CAREFUL** with the distinction.
  12. - Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends.
  13. This means if you somehow misspell a property definition or fail to adhere to the dot-notation syntax and such, your setting
  14. is entirely refused by CAS and likely the feature it controls will never be activated in the way you intend.
  15. ## Indexed Settings
  16. CAS settings able to accept multiple values are typically documented with an index, such as `cas.some.setting[0]=value`.
  17. The index `[0]` is meant to be incremented by the adopter to allow for distinct multiple configuration blocks:
  18. ```properties
  19. # cas.some.setting[0]=value1
  20. # cas.some.setting[1]=value2
  21. ```
  22. ## Trust But Verify
  23. If you are unsure about the meaning of a given CAS setting, do **NOT** simply turn it on without hesitation.
  24. Review the codebase or better yet, [ask questions](/cas/Mailing-Lists.html) to clarify the intended behavior.
  25. <div class="alert alert-info"><strong>Keep It Simple</strong><p>If you do not know or cannot tell what a setting does, you do not need it.</p></div>
  26. ## Time Unit of Measure
  27. All CAS settings that deal with time units, unless noted otherwise,
  28. should support the duration syntax for full clarity on unit of measure:
  29. ```bash
  30. "PT20S" -- parses as "20 seconds"
  31. "PT15M" -- parses as "15 minutes"
  32. "PT10H" -- parses as "10 hours"
  33. "P2D" -- parses as "2 days"
  34. "P2DT3H4M" -- parses as "2 days, 3 hours and 4 minutes"
  35. ```
  36. The native numeric syntax is still supported though you will have to refer to the docs
  37. in each case to learn the exact unit of measure.
  38. ## Authentication Throttling
  39. Certain functionality in CAS, such as [OAuth](OAuth-OpenId-Authentication.html)
  40. or [REST API](../protocol/REST-Protocol.html), allow you to throttle requests to specific endpoints in addition to the more
  41. generic authentication throttling functionality applied during the login flow and authentication attempts.
  42. To fully deliver this functionality, it is expected that [authentication throttling](Configuring-Authentication-Throttling.html) is turned on.
  43. ## Authentication Credential Selection
  44. A number of authentication handlers are allowed to determine whether they can operate on the provided credential
  45. and as such lend themselves to be tried and tested during the authentication handler selection phase. The credential criteria
  46. may be one of the following options:
  47. - A regular expression pattern that is tested against the credential identifier
  48. - A fully qualified class name of your own design that looks similar to the below example:
  49. ```java
  50. import java.util.function.Predicate;
  51. import org.apereo.cas.authentication.Credential;
  52. public class PredicateExample implements Predicate<Credential> {
  53. @Override
  54. public boolean test(final Credential credential) {
  55. // Examine the credential and return true/false
  56. }
  57. }
  58. ```
  59. - Path to an external Groovy script that looks similar to the below example:
  60. ```groovy
  61. import org.apereo.cas.authentication.Credential
  62. import java.util.function.Predicate
  63. class PredicateExample implements Predicate<Credential> {
  64. @Override
  65. boolean test(final Credential credential) {
  66. // test and return result
  67. }
  68. }
  69. ```
  70. ## Password Encoding
  71. Certain aspects of CAS such as authentication handling support configuration of
  72. password encoding. Most options are based on Spring Security's [support for password encoding](http://docs.spring.io/spring-security/site/docs/current/apidocs/org/springframework/security/crypto/password/PasswordEncoder.html).
  73. The following options related to password encoding support in CAS apply equally to a number of CAS components (authentication handlers, etc) given the component's *configuration key*:
  74. ```properties
  75. # ${configurationKey}.passwordEncoder.type=NONE|DEFAULT|STANDARD|BCRYPT|SCRYPT|PBKDF2
  76. # ${configurationKey}.passwordEncoder.characterEncoding=
  77. # ${configurationKey}.passwordEncoder.encodingAlgorithm=
  78. # ${configurationKey}.passwordEncoder.secret=
  79. # ${configurationKey}.passwordEncoder.strength=16
  80. ```
  81. The following options are supported:
  82. | Type | Description
  83. |-------------------------|----------------------------------------------------------------------------------------------------
  84. | `NONE` | No password encoding (i.e. plain-text) takes place.
  85. | `DEFAULT` | Use the `DefaultPasswordEncoder` of CAS. For message-digest algorithms via `characterEncoding` and `encodingAlgorithm`.
  86. | `BCRYPT` | Use the `BCryptPasswordEncoder` based on the `strength` provided and an optional `secret`.
  87. | `SCRYPT` | Use the `SCryptPasswordEncoder`.
  88. | `PBKDF2` | Use the `Pbkdf2PasswordEncoder` based on the `strength` provided and an optional `secret`.
  89. | `STANDARD` | Use the `StandardPasswordEncoder` based on the `secret` provided.
  90. | `org.example.MyEncoder` | An implementation of `PasswordEncoder` of your own choosing.
  91. | `file:///path/to/script.groovy` | Path to a Groovy script charged with handling password encoding operations.
  92. In cases where you plan to design your own password encoder or write scripts to do so, you may also need to ensure the overlay has the following modules available at runtime:
  93. ```xml
  94. <dependency>
  95. <groupId>org.springframework.security</groupId>
  96. <artifactId>spring-security-core</artifactId>
  97. </dependency>
  98. ```
  99. If you need to design your own password encoding scheme where the type is specified as a fully qualified Java class name, the structure of the class would be
  100. similar to the following:
  101. ```java
  102. package org.example.cas;
  103. import org.springframework.security.crypto.codec.*;
  104. import org.springframework.security.crypto.password.*;
  105. public class MyEncoder extends AbstractPasswordEncoder {
  106. @Override
  107. protected byte[] encode(CharSequence rawPassword, byte[] salt) {
  108. return ...
  109. }
  110. }
  111. ```
  112. If you need to design your own password encoding scheme where the type is specified as a path to a Groovy script, the structure of the script would be similar
  113. to the following:
  114. ```groovy
  115. import java.util.*
  116. def byte[] run(final Object... args) {
  117. def rawPassword = args[0]
  118. def generatedSalt = args[1]
  119. def logger = args[2]
  120. def casApplicationContext = args[3]
  121. logger.debug("Encoding password...")
  122. return ...
  123. }
  124. ```
  125. ## Authentication Principal Transformation
  126. Authentication handlers that generally deal with username-password credentials
  127. can be configured to transform the user id prior to executing the authentication sequence.
  128. The following options may be used:
  129. | Type | Description
  130. |-------------------------|----------------------------------------------------------
  131. | `NONE` | Do not apply any transformations.
  132. | `UPPERCASE` | Convert the username to uppercase.
  133. | `LOWERCASE` | Convert the username to lowercase.
  134. Authentication handlers as part of principal transformation may also be provided a path to a Groovy script to transform the provided username. The outline of the script may take on the following form:
  135. ```groovy
  136. def String run(final Object... args) {
  137. def providedUsername = args[0]
  138. def logger = args[1]
  139. return providedUsername.concat("SomethingElse)
  140. }
  141. ```
  142. The following options related to principal transformation support in CAS apply equally to a number of CAS components (authentication handlers, etc) given the component's *configuration key*:
  143. ```properties
  144. # ${configurationKey}.principalTransformation.pattern=(.+)@example.org
  145. # ${configurationKey}.principalTransformation.groovy.location=file:///etc/cas/config/principal.groovy
  146. # ${configurationKey}.principalTransformation.suffix=
  147. # ${configurationKey}.principalTransformation.caseConversion=NONE|UPPERCASE|LOWERCASE
  148. # ${configurationKey}.principalTransformation.prefix=
  149. ```
  150. ## Cookie Properties
  151. The following common properties configure cookie generator support in CAS.
  152. ```properties
  153. # ${configurationKey}.name=
  154. # ${configurationKey}.domain=
  155. # ${configurationKey}.path=
  156. # ${configurationKey}.httpOnly=true
  157. # ${configurationKey}.secure=true
  158. # ${configurationKey}.maxAge=-1
  159. ```
  160. ## Hibernate & JDBC
  161. Control global properties that are relevant to Hibernate,
  162. when CAS attempts to employ and utilize database resources,
  163. connections and queries.
  164. ```properties
  165. # cas.jdbc.showSql=true
  166. # cas.jdbc.genDdl=true
  167. ```
  168. ### Database Settings
  169. The following options related to JPA/JDBC support in CAS apply equally to a number of CAS components (ticket registries, etc) given the component's *configuration key*:
  170. ```properties
  171. # ${configurationKey}.user=sa
  172. # ${configurationKey}.password=
  173. # ${configurationKey}.driverClass=org.hsqldb.jdbcDriver
  174. # ${configurationKey}.url=jdbc:hsqldb:mem:cas-hsql-database
  175. # ${configurationKey}.dialect=org.hibernate.dialect.HSQLDialect
  176. # ${configurationKey}.failFastTimeout=1
  177. # ${configurationKey}.isolationLevelName=ISOLATION_READ_COMMITTED
  178. # ${configurationKey}.healthQuery=
  179. # ${configurationKey}.isolateInternalQueries=false
  180. # ${configurationKey}.leakThreshold=10
  181. # ${configurationKey}.propagationBehaviorName=PROPAGATION_REQUIRED
  182. # ${configurationKey}.batchSize=1
  183. # ${configurationKey}.defaultCatalog=
  184. # ${configurationKey}.defaultSchema=
  185. # ${configurationKey}.ddlAuto=create-drop
  186. # ${configurationKey}.autocommit=false
  187. # ${configurationKey}.idleTimeout=5000
  188. # ${configurationKey}.dataSourceName=
  189. # ${configurationKey}.dataSourceProxy=false
  190. # Hibernate-specific properties (i.e. `hibernate.globally_quoted_identifiers`)
  191. # ${configurationKey}.properties.propertyName=propertyValue
  192. # ${configurationKey}.pool.suspension=false
  193. # ${configurationKey}.pool.minSize=6
  194. # ${configurationKey}.pool.maxSize=18
  195. # ${configurationKey}.pool.maxWait=2000
  196. # ${configurationKey}.pool.timeoutMillis=1000
  197. ```
  198. ### Container-based JDBC Connections
  199. If you are planning to use a container-managed JDBC connection with CAS (i.e. JPA Ticket/Service Registry, etc)
  200. then you can set the `dataSourceName` property on any of the configuration items that require a database
  201. connection. When using a container configured data source, many of the pool related parameters will not be used.
  202. If `dataSourceName` is specified but the JNDI lookup fails, a data source will be created with the configured
  203. (or default) CAS pool parameters.
  204. If you experience classloading errors while trying to use a container datasource, you can try
  205. setting the `dataSourceProxy` setting to true which will wrap the container datasource in
  206. a way that may resolve the error.
  207. The `dataSourceName` property can be either a JNDI name for the datasource or a resource name prefixed with
  208. `java:/comp/env/`. If it is a resource name then you need an entry in a `web.xml` that you can add to your
  209. CAS overlay. It should contain an entry like this:
  210. ```xml
  211. <resource-ref>
  212. <res-ref-name>jdbc/casDataSource</res-ref-name>
  213. <res-type>javax.sql.DataSource</res-type>
  214. <res-auth>Container</res-auth>
  215. </resource-ref>
  216. ```
  217. In Apache Tomcat a container datasource can be defined like this in the `context.xml`:
  218. ```xml
  219. <Resource name="jdbc/casDataSource"
  220. auth="Container"
  221. type="javax.sql.DataSource"
  222. driverClassName="org.postgresql.Driver"
  223. url="jdbc:postgresql://casdb.example.com:5432/xyz_db"
  224. username="cas"
  225. password="xyz"
  226. testWhileIdle="true"
  227. testOnBorrow="true"
  228. testOnReturn="false"
  229. validationQuery="select 1"
  230. validationInterval="30000"
  231. timeBetweenEvictionRunsMillis="30000"
  232. factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
  233. minIdle="0"
  234. maxIdle="5"
  235. initialSize="0"
  236. maxActive="20"
  237. maxWait="10000" />
  238. ```
  239. In Jetty, a pool can be put in JNDI with a `jetty.xml` or `jetty-env.xml` file like this:
  240. ```xml
  241. <?xml version="1.0"?>
  242. <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
  243. <Configure class="org.eclipse.jetty.webapp.WebAppContext">
  244. <New id="datasource.cas" class="org.eclipse.jetty.plus.jndi.Resource">
  245. <Arg></Arg> <!-- empty scope arg is JVM scope -->
  246. <Arg>jdbc/casDataSource</Arg> <!-- name that matches resource in web.xml-->
  247. <Arg>
  248. <New class="org.apache.commons.dbcp.BasicDataSource">
  249. <Set name="driverClassName">oracle.jdbc.OracleDriver</Set>
  250. <Set name="url">jdbc:oracle:thin:@//casdb.example.com:1521/ntrs"</Set>
  251. <Set name="username">cas</Set>
  252. <Set name="password">xyz</Set>
  253. <Set name="validationQuery">select dummy from dual</Set>
  254. <Set name="testOnBorrow">true</Set>
  255. <Set name="testOnReturn">false</Set>
  256. <Set name="testWhileIdle">false</Set>
  257. <Set name="defaultAutoCommit">false</Set>
  258. <Set name="initialSize">0</Set>
  259. <Set name="maxActive">15</Set>
  260. <Set name="minIdle">0</Set>
  261. <Set name="maxIdle">5</Set>
  262. <Set name="maxWait">2000</Set>
  263. </New>
  264. </Arg>
  265. </New>
  266. </Configure>
  267. ```
  268. ## Signing & Encryption
  269. A number of components in CAS accept signing and encryption keys. In most scenarios if keys are not provided, CAS will auto-generate them. The following instructions apply if you wish to manually and beforehand create the signing and encryption keys.
  270. Note that if you are asked to create a [JWK](https://tools.ietf.org/html/rfc7517) of a certain size for the key, you are to use the following set of commands to generate the token:
  271. ```bash
  272. wget https://raw.githubusercontent.com/apereo/cas/master/etc/jwk-gen.jar
  273. java -jar jwk-gen.jar -t oct -s [size]
  274. ```
  275. The outcome would be similar to:
  276. ```json
  277. {
  278. "kty": "oct",
  279. "kid": "...",
  280. "k": "..."
  281. }
  282. ```
  283. The generated value for `k` needs to be assigned to the relevant CAS settings. Note that keys generated via the above algorithm are processed by CAS using the Advanced Encryption Standard (`AES`) algorithm which is a specification for the encryption of electronic data established by the U.S. National Institute of Standards and Technology.
  284. ### Settings
  285. The following crypto options apply equally to relevant CAS components (ticket registries, etc) given the component's *configuration key*:
  286. ```properties
  287. # ${configurationKey}.crypto.signing.key=
  288. # ${configurationKey}.crypto.signing.keySize=
  289. # ${configurationKey}.crypto.encryption.key=
  290. # ${configurationKey}.crypto.encryption.keySize=
  291. # ${configurationKey}.crypto.alg=AES
  292. # ${configurationKey}.crypto.enabled=false
  293. ```
  294. ### RSA Keys
  295. Certain features such as the ability to produce [JWTs as CAS tickets](../installation/Configure-ServiceTicket-JWT.html) may allow you to use the `RSA` algorithm with public/private keypairs for signing and encryption. This behavior may prove useful generally in cases where the consumer of the CAS-encoded payload is an outsider and a client application that need not have access to the signing secrets directly and visibly and may only be given a half truth vis-a-vis a public key to verify the payload authenticity and decode it. This particular option makes little sense in situations where CAS itself is both a producer and a consumer of the payload.
  296. <div class="alert alert-info"><strong>Remember</strong><p>Signing and encryption options are not mutually exclusive. While it would be rather nonsensical, it is entirely possible for CAS to use <code>AES</code> keys for signing and <code>RSA</code> keys for encryption, or vice versa.</p></div>
  297. In order to enable RSA functionality for signing payloads, you will need to generate a private/public keypair via the following sample commands:
  298. ```bash
  299. openssl genrsa -out private.key 2048
  300. openssl rsa -pubout -in private.key -out public.key -inform PEM -outform DER
  301. ```
  302. The private key path (i.e. `file:///path/to/private.key`) needs to be configured for the signing key in CAS properties for the relevant feature. The public key needs to be shared with client applications and consumers of the payload in order to validate the payload signature.
  303. ```properties
  304. # cas.xyz.crypto.signing.key=file:///etc/cas/config/private.key
  305. ```
  306. <div class="alert alert-info"><strong>Key Size</strong><p>Remember that RSA key sizes are required to be at least <code>2048</code> and above. Smaller key sizes are not accepted by CAS and will cause runtime errors. Choose wisely.</p></div>
  307. In order to enable RSA functionality for encrypting payloads, you will need to essentially execute the reverse of the above operations. The client application will provide you with a public key which will be used to encrypt the payload and whose path (i.e. `file:///path/to/public.key`) needs to be configured for the encryption key in CAS properties for the relevant feature. Once the payload is submitted, the client should use its own private key to decode the payload and unpack it.
  308. ```properties
  309. # cas.xyz.crypto.encryption.key=file:///etc/cas/config/public.key
  310. ```
  311. ## Person Directory Principal Resolution
  312. The following options related to Person Directory support in CAS when it attempts to resolve and build the authenticated principal, given the component's *configuration key*:
  313. ```properties
  314. # ${configurationKey}.principalAttribute=uid,sAMAccountName,etc
  315. # ${configurationKey}.returnNull=false
  316. # ${configurationKey}.principalResolutionFailureFatal=false
  317. # ${configurationKey}.useExistingPrincipalId=false
  318. ```
  319. ## InfluxDb Configuration
  320. The following options related to InfluxDb support in CAS apply equally to a number of CAS components given the component's *configuration key*:
  321. ```properties
  322. # ${configurationKey}.url=http://localhost:8086
  323. # ${configurationKey}.username=root
  324. # ${configurationKey}.password=root
  325. # ${configurationKey}.retentionPolicy=autogen
  326. # ${configurationKey}.dropDatabase=false
  327. # ${configurationKey}.pointsToFlush=100
  328. # ${configurationKey}.batchInterval=PT5S
  329. # ${configurationKey}.consistencyLevel=ALL
  330. ```
  331. ## Hazelcast Configuration
  332. The following options related to Hazelcast support in CAS apply equally to a number of CAS components given the component's *configuration key*:
  333. ```properties
  334. # ${configurationKey}.cluster.members=123.456.789.000,123.456.789.001
  335. # ${configurationKey}.cluster.instanceName=localhost
  336. # ${configurationKey}.cluster.port=5701
  337. ```
  338. More advanced Hazelcast configuration settings are listed below, given the component's *configuration key*:
  339. ```properties
  340. # ${configurationKey}.cluster.tcpipEnabled=true
  341. # ${configurationKey}.cluster.partitionMemberGroupType=HOST_AWARE|CUSTOM|PER_MEMBER|ZONE_AWARE|SPI
  342. # ${configurationKey}.cluster.evictionPolicy=LRU
  343. # ${configurationKey}.cluster.maxNoHeartbeatSeconds=300
  344. # ${configurationKey}.cluster.loggingType=slf4j
  345. # ${configurationKey}.cluster.portAutoIncrement=true
  346. # ${configurationKey}.cluster.maxHeapSizePercentage=85
  347. # ${configurationKey}.cluster.backupCount=1
  348. # ${configurationKey}.cluster.asyncBackupCount=0
  349. # ${configurationKey}.cluster.maxSizePolicy=USED_HEAP_PERCENTAGE
  350. # ${configurationKey}.cluster.timeout=5
  351. ```
  352. ### Multicast Discovery
  353. ```properties
  354. # ${configurationKey}.cluster.multicastTrustedInterfaces=
  355. # ${configurationKey}.cluster.multicastEnabled=false
  356. # ${configurationKey}.cluster.multicastPort=
  357. # ${configurationKey}.cluster.multicastGroup=
  358. # ${configurationKey}.cluster.multicastTimeout=2
  359. # ${configurationKey}.cluster.multicastTimeToLive=32
  360. ```
  361. ### AWS EC2 Discovery
  362. ```properties
  363. # ${configurationKey}.cluster.discovery.enabled=true
  364. # ${configurationKey}.cluster.discovery.aws.accessKey=
  365. # ${configurationKey}.cluster.discovery.aws.secretKey=
  366. # ${configurationKey}.cluster.discovery.aws.iamRole=
  367. # ${configurationKey}.cluster.discovery.aws.region=us-east-1
  368. # ${configurationKey}.cluster.discovery.aws.hostHeader=
  369. # ${configurationKey}.cluster.discovery.aws.securityGroupName=
  370. # ${configurationKey}.cluster.discovery.aws.tagKey=
  371. # ${configurationKey}.cluster.discovery.aws.tagValue=
  372. # ${configurationKey}.cluster.discovery.aws.port=-1
  373. # ${configurationKey}.cluster.discovery.aws.connectionTimeoutSeconds=5
  374. ```
  375. ### Apache jclouds Discovery
  376. ```properties
  377. # ${configurationKey}.cluster.discovery.enabled=true
  378. # ${configurationKey}.cluster.discovery.jclouds.provider=
  379. # ${configurationKey}.cluster.discovery.jclouds.identity=
  380. # ${configurationKey}.cluster.discovery.jclouds.credential=
  381. # ${configurationKey}.cluster.discovery.jclouds.endpoint=
  382. # ${configurationKey}.cluster.discovery.jclouds.zones=
  383. # ${configurationKey}.cluster.discovery.jclouds.regions=
  384. # ${configurationKey}.cluster.discovery.jclouds.tagKeys=
  385. # ${configurationKey}.cluster.discovery.jclouds.tagValues=
  386. # ${configurationKey}.cluster.discovery.jclouds.group=
  387. # ${configurationKey}.cluster.discovery.jclouds.port=-1
  388. # ${configurationKey}.cluster.discovery.jclouds.roleName=
  389. # ${configurationKey}.cluster.discovery.jclouds.credentialPath=
  390. ```
  391. ### Kubernetes Discovery
  392. ```properties
  393. # ${configurationKey}.cluster.discovery.enabled=true
  394. # ${configurationKey}.cluster.discovery.kubernetes.serviceDns=
  395. # ${configurationKey}.cluster.discovery.kubernetes.serviceDnsTimeout=-1
  396. # ${configurationKey}.cluster.discovery.kubernetes.serviceName=
  397. # ${configurationKey}.cluster.discovery.kubernetes.serviceLabelName=
  398. # ${configurationKey}.cluster.discovery.kubernetes.serviceLabelValue=
  399. # ${configurationKey}.cluster.discovery.kubernetes.namespace=
  400. # ${configurationKey}.cluster.discovery.kubernetes.resolveNotReadyAddresses=false
  401. # ${configurationKey}.cluster.discovery.kubernetes.kubernetesMaster=
  402. # ${configurationKey}.cluster.discovery.kubernetes.apiToken=
  403. ```
  404. ### Docker Swarm Discovery
  405. ```properties
  406. # ${configurationKey}.cluster.discovery.enabled=true
  407. # ${configurationKey}.cluster.discovery.dockerSwarm.dnsProvider.enabled=true
  408. # ${configurationKey}.cluster.discovery.dockerSwarm.dnsProvider.serviceName=
  409. # ${configurationKey}.cluster.discovery.dockerSwarm.dnsProvider.servicePort=5701
  410. # ${configurationKey}.cluster.discovery.dockerSwarm.dnsProvider.peerServices=service-a,service-b,etc
  411. # ${configurationKey}.cluster.discovery.dockerSwarm.memberProvider.enabled=true
  412. # ${configurationKey}.cluster.discovery.dockerSwarm.memberProvider.groupName=
  413. # ${configurationKey}.cluster.discovery.dockerSwarm.memberProvider.groupPassword=
  414. # ${configurationKey}.cluster.discovery.dockerSwarm.memberProvider.dockerNetworkNames=
  415. # ${configurationKey}.cluster.discovery.dockerSwarm.memberProvider.dockerServiceNames=
  416. # ${configurationKey}.cluster.discovery.dockerSwarm.memberProvider.dockerServiceLabels=
  417. # ${configurationKey}.cluster.discovery.dockerSwarm.memberProvider.swarmMgrUri=
  418. # ${configurationKey}.cluster.discovery.dockerSwarm.memberProvider.skipVerifySsl=false
  419. # ${configurationKey}.cluster.discovery.dockerSwarm.memberProvider.hazelcastPeerPort=5701
  420. ```
  421. ### Microsoft Azure Discovery
  422. ```properties
  423. # ${configurationKey}.cluster.discovery.enabled=true
  424. # ${configurationKey}.cluster.discovery.azure.subscriptionId=
  425. # ${configurationKey}.cluster.discovery.azure.clientId=
  426. # ${configurationKey}.cluster.discovery.azure.clientSecret=
  427. # ${configurationKey}.cluster.discovery.azure.tenantId=
  428. # ${configurationKey}.cluster.discovery.azure.clusterId=
  429. # ${configurationKey}.cluster.discovery.azure.groupName=
  430. ```
  431. ## RADIUS Configuration
  432. The following options related to RADIUS support in CAS apply equally to a number of CAS components (authentication, etc)
  433. given the component's *configuration key*.
  434. `server` parameters defines identification values of authenticated service (CAS server), primarily `server.protocol`
  435. for communication to RADIUS server identified by `client`.
  436. `client` parameters defines values for connecting RADIUS server.
  437. Parameter `client.inetAddress` has possibility to contain more addresses separated by comma to define failover servers
  438. when `failoverOnException` is set.
  439. ```properties
  440. # ${configurationKey}.server.nasPortId=-1
  441. # ${configurationKey}.server.nasRealPort=-1
  442. # ${configurationKey}.server.protocol=EAP_MSCHAPv2
  443. # ${configurationKey}.server.retries=3
  444. # ${configurationKey}.server.nasPortType=-1
  445. # ${configurationKey}.server.nasPort=-1
  446. # ${configurationKey}.server.nasIpAddress=
  447. # ${configurationKey}.server.nasIpv6Address=
  448. # ${configurationKey}.server.nasIdentifier=-1
  449. # ${configurationKey}.client.authenticationPort=1812
  450. # ${configurationKey}.client.sharedSecret=N0Sh@ar3d$ecReT
  451. # ${configurationKey}.client.socketTimeout=0
  452. # ${configurationKey}.client.inetAddress=localhost
  453. # ${configurationKey}.client.accountingPort=1813
  454. # ${configurationKey}.failoverOnException=false
  455. # ${configurationKey}.failoverOnAuthenticationFailure=false
  456. ```
  457. ## CouchDb Configuration
  458. The following options related to CouchDb support in CAS apply equally to a number of CAS components (ticket registries, etc) given the component's *configuration key*:
  459. ```properties
  460. # ${configurationKey}.couchDb.url=http://localhost:5984
  461. # ${configurationKey}.couchDb.username=
  462. # ${configurationKey}.couchDb.password=
  463. # ${configurationKey}.couchDb.socketTimeout=10000
  464. # ${configurationKey}.couchDb.connectionTimeout=1000
  465. # ${configurationKey}.couchDb.dropCollection=false
  466. # ${configurationKey}.couchDb.maxConnections=20
  467. # ${configurationKey}.couchDb.enableSSL=
  468. # ${configurationKey}.couchDb.relaxedSSLSettings=
  469. # ${configurationKey}.couchDb.caching=true
  470. # ${configurationKey}.couchDb.maxCacheEntries=1000
  471. # ${configurationKey}.couchDb.maxObjectSizeBytes=8192
  472. # ${configurationKey}.couchDb.useExpectContinue=true
  473. # ${configurationKey}.couchDb.cleanupIdleConnections=true
  474. # ${configurationKey}.couchDb.createIfNotExists=true
  475. # ${configurationKey}.couchDb.proxyHost=
  476. # ${configurationKey}.couchDb.proxyPort=-1
  477. # Defaults are based on the feature name.
  478. # ${configurationKey}.couchDb.dbName=
  479. # For the few features that can't have update conflicts automatically resolved.
  480. # ${configurationKey}.couchDb.retries=5
  481. # Depending on the feature at hand, CAS may perform some actions asynchronously.
  482. # ${configurationKey}.couchDb.asynchronous=true
  483. ```
  484. ## MongoDb Configuration
  485. The following options related to MongoDb support in CAS apply equally to a number of CAS components (ticket registries, etc) given the component's *configuration key*:
  486. ```properties
  487. # ${configurationKey}.mongo.host=localhost
  488. # ${configurationKey}.mongo.clientUri=localhost
  489. # ${configurationKey}.mongo.idleTimeout=30000
  490. # ${configurationKey}.mongo.port=27017
  491. # ${configurationKey}.mongo.dropCollection=false
  492. # ${configurationKey}.mongo.socketKeepAlive=false
  493. # ${configurationKey}.mongo.password=
  494. # Depending on the feature at hand, CAS may decide to dynamically create its own collections and ignore this setting.
  495. # ${configurationKey}.mongo.collection=cas-service-registry
  496. # ${configurationKey}.mongo.databaseName=cas-mongo-database
  497. # ${configurationKey}.mongo.timeout=5000
  498. # ${configurationKey}.mongo.userId=
  499. # ${configurationKey}.mongo.writeConcern=NORMAL
  500. # ${configurationKey}.mongo.authenticationDatabaseName=
  501. # ${configurationKey}.mongo.replicaSet=
  502. # ${configurationKey}.mongo.sslEnabled=false
  503. # ${configurationKey}.mongo.conns.lifetime=60000
  504. # ${configurationKey}.mongo.conns.perHost=10
  505. ```
  506. ## DynamoDb Configuration
  507. The following options related to DynamoDb support in CAS apply equally to a number of CAS components (ticket registries, etc) given the component's *configuration key*:
  508. ```properties
  509. # ${configurationKey}.dynamoDb.dropTablesOnStartup=false
  510. # ${configurationKey}.dynamoDb.preventTableCreationOnStartup=false
  511. # ${configurationKey}.dynamoDb.timeOffset=0
  512. # ${configurationKey}.dynamoDb.localInstance=false
  513. # ${configurationKey}.dynamoDb.readCapacity=10
  514. # ${configurationKey}.dynamoDb.writeCapacity=10
  515. # ${configurationKey}.dynamoDb.connectionTimeout=5000
  516. # ${configurationKey}.dynamoDb.requestTimeout=5000
  517. # ${configurationKey}.dynamoDb.socketTimeout=5000
  518. # ${configurationKey}.dynamoDb.useGzip=false
  519. # ${configurationKey}.dynamoDb.useReaper=false
  520. # ${configurationKey}.dynamoDb.useThrottleRetries=false
  521. # ${configurationKey}.dynamoDb.useTcpKeepAlive=false
  522. # ${configurationKey}.dynamoDb.protocol=HTTPS
  523. # ${configurationKey}.dynamoDb.clientExecutionTimeout=10000
  524. # ${configurationKey}.dynamoDb.cacheResponseMetadata=false
  525. # ${configurationKey}.dynamoDb.localAddress=
  526. # ${configurationKey}.dynamoDb.maxConnections=10
  527. ```
  528. AWS settings for this feature are available [here](#amazon-integration-settings).
  529. ## RESTful Integrations
  530. The following options related to features in CAS that provide REST support to fetch and update data. These settings apply equally, given the component's *configuration key*:
  531. ```properties
  532. # ${configurationKey}.method=GET|POST
  533. # ${configurationKey}.order=0
  534. # ${configurationKey}.caseInsensitive=false
  535. # ${configurationKey}.basicAuthUsername=uid
  536. # ${configurationKey}.basicAuthPassword=password
  537. # ${configurationKey}.url=https://rest.somewhere.org/attributes
  538. ```
  539. ## Redis Configuration
  540. The following options related to Redis support in CAS apply equally to a number of CAS components (ticket registries, etc) given the component's *configuration key*:
  541. ```properties
  542. # ${configurationKey}.redis.host=localhost
  543. # ${configurationKey}.redis.database=0
  544. # ${configurationKey}.redis.port=6380
  545. # ${configurationKey}.redis.password=
  546. # ${configurationKey}.redis.timeout=2000
  547. # ${configurationKey}.redis.useSsl=false
  548. # ${configurationKey}.redis.pool.max-active=20
  549. # ${configurationKey}.redis.pool.maxIdle=8
  550. # ${configurationKey}.redis.pool.minIdle=0
  551. # ${configurationKey}.redis.pool.maxActive=8
  552. # ${configurationKey}.redis.pool.maxWait=-1
  553. # ${configurationKey}.redis.pool.numTestsPerEvictionRun=0
  554. # ${configurationKey}.redis.pool.softMinEvictableIdleTimeMillis=0
  555. # ${configurationKey}.redis.pool.minEvictableIdleTimeMillis=0
  556. # ${configurationKey}.redis.pool.lifo=true
  557. # ${configurationKey}.redis.pool.fairness=false
  558. # ${configurationKey}.redis.pool.testOnCreate=false
  559. # ${configurationKey}.redis.pool.testOnBorrow=false
  560. # ${configurationKey}.redis.pool.testOnReturn=false
  561. # ${configurationKey}.redis.pool.testWhileIdle=false
  562. # ${configurationKey}.redis.sentinel.master=mymaster
  563. # ${configurationKey}.redis.sentinel.nodes[0]=localhost:26377
  564. # ${configurationKey}.redis.sentinel.nodes[1]=localhost:26378
  565. # ${configurationKey}.redis.sentinel.nodes[2]=localhost:26379
  566. ```
  567. ## DDL Configuration
  568. Note that the default value for Hibernate's DDL setting is `create-drop` which may not be appropriate for use in production. Setting the value to
  569. `validate` may be more desirable, but any of the following options can be used:
  570. | Type | Description
  571. |----------------------|----------------------------------------------------------
  572. | `validate` | Validate the schema, but make no changes to the database.
  573. | `update` | Update the schema.
  574. | `create` | Create the schema, destroying previous data.
  575. | `create-drop` | Drop the schema at the end of the session.
  576. | `none` | Do nothing.
  577. Note that during a version migration where any schema has changed `create-drop` will result
  578. in the loss of all data as soon as CAS is started. For transient data like tickets this is probably
  579. not an issue, but in cases like the audit table important data could be lost. Using `update`, while safe
  580. for data, is confirmed to result in invalid database state. `validate` or `none` settings
  581. are likely the only safe options for production use.
  582. For more information on configuration of transaction levels and propagation behaviors,
  583. please review [this guide](http://docs.spring.io/spring-framework/docs/current/javadoc-api/).
  584. ## SAML2 Service Provider Integrations
  585. The settings defined for each service provider simply attempt to automate the creation of
  586. a [SAML service definition](Configuring-SAML2-Authentication.html#saml-services) and nothing more. If you find the
  587. applicable settings lack in certain areas, it is best to fall back onto the native configuration strategy for registering
  588. SAML service providers with CAS which would depend on your service registry of choice.
  589. Each SAML service provider supports the following settings:
  590. | Name | Description
  591. |-----------------------|---------------------------------------------------------------------------
  592. | `metadata` | Location of metadata for the service provider (i.e URL, path, etc)
  593. | `name` | The name of the service provider registered in the service registry.
  594. | `description` | The description of the service provider registered in the service registry.
  595. | `nameIdAttribute` | Attribute to use when generating name ids for this service provider.
  596. | `nameIdFormat` | The name of the service provider registered in the service registry.
  597. | `attributes` | Attributes to release to the service provider, which may virtually be mapped and renamed.
  598. | `signatureLocation` | Signature location to verify metadata.
  599. | `entityIds` | List of entity ids allowed for this service provider.
  600. | `signResponses` | Indicate whether responses should be signed. Default is `true`.
  601. | `signAssertions` | Indicate whether assertions should be signed. Default is `false`.
  602. The only required setting that would activate the automatic configuration for a service provider is the presence and definition of metadata. All other settings are optional.
  603. The following options apply equally to SAML2 service provider integrations, given the provider's *configuration key*:
  604. ```properties
  605. # ${configurationKey}.metadata=/etc/cas/saml/dropbox.xml
  606. # ${configurationKey}.name=Dropbox
  607. # ${configurationKey}.description=Dropbox Integration
  608. # ${configurationKey}.nameIdAttribute=mail
  609. # ${configurationKey}.nameIdFormat=
  610. # ${configurationKey}.signatureLocation=
  611. # ${configurationKey}.attributes=
  612. # ${configurationKey}.entityIds=
  613. # ${configurationKey}.signResponses=
  614. # ${configurationKey}.signAssertions=
  615. ```
  616. ## Multifactor Authentication Providers
  617. All configurable multifactor authentication providers have these base properties available given the provider's *configuration key*:
  618. ```properties
  619. # ${configurationKey}.rank=
  620. # ${configurationKey}.id=
  621. # ${configurationKey}.name=
  622. # ${configurationKey}.failureMode=UNDEFINED
  623. ```
  624. ## Multifactor Authentication Bypass
  625. The following bypass options apply equally to multifactor authentication providers given the provider's *configuration key*:
  626. ```properties
  627. # ${configurationKey}.bypass.type=DEFAULT|GROOVY|REST
  628. # ${configurationKey}.bypass.principalAttributeName=bypass|skip
  629. # ${configurationKey}.bypass.principalAttributeValue=true|enabled.+
  630. # ${configurationKey}.bypass.authenticationAttributeName=bypass|skip
  631. # ${configurationKey}.bypass.authenticationAttributeValue=allowed.+|enabled.+
  632. # ${configurationKey}.bypass.authenticationHandlerName=AcceptUsers.+
  633. # ${configurationKey}.bypass.authenticationMethodName=LdapAuthentication.+
  634. # ${configurationKey}.bypass.credentialClassType=UsernamePassword.+
  635. # ${configurationKey}.bypass.httpRequestRemoteAddress=127.+|example.*
  636. # ${configurationKey}.bypass.httpRequestHeaders=header-X-.+|header-Y-.+
  637. # ${configurationKey}.groovy.location=file:/etc/cas/config/mfa-bypass.groovy
  638. ```
  639. If multifactor authentication bypass is determined via REST,
  640. RESTful settings are available [here](#restful-integrations) under the configuration key `${configurationKey}.bypass.rest`.
  641. ## Couchbase Integration Settings
  642. The following options are shared and apply when CAS is configured to integrate with Couchbase (i.e ticket registry, etc), given the provider's *configuration key*:
  643. ```properties
  644. # ${configurationKey}.nodeSet=localhost:8091
  645. # ${configurationKey}.password=
  646. # ${configurationKey}.queryEnabled=true
  647. # ${configurationKey}.bucket=default
  648. # ${configurationKey}.timeout=PT30S
  649. ```
  650. ## Amazon Integration Settings
  651. The following options are shared and apply when CAS is configured to integrate with various
  652. Amazon Web Service features, given the provider's *configuration key*:
  653. ```properties
  654. # Path to an external properties file that contains 'accessKey' and 'secretKey' fields.
  655. # ${configurationKey}.credentialsPropertiesFile=file:/path/to/file.properties
  656. # Alternatively, you may directly provide credentials to CAS
  657. # ${configurationKey}.credentialAccessKey=
  658. # ${configurationKey}.credentialSecretKey=
  659. # ${configurationKey}.endpoint=http://localhost:8000
  660. # ${configurationKey}.region=US_WEST_2|US_EAST_2|EU_WEST_2|<REGION-NAME>
  661. # ${configurationKey}.regionOverride=
  662. # ${configurationKey}.serviceNameIntern=
  663. # ${configurationKey}.localAddress=
  664. ```
  665. ## Memcached Integration Settings
  666. The following options are shared and apply when CAS is configured to integrate with memcached (i.e ticket registry, etc), given the provider's *configuration key*:
  667. ```properties
  668. # ${configurationKey}.memcached.servers=localhost:11211
  669. # ${configurationKey}.memcached.locatorType=ARRAY_MOD
  670. # ${configurationKey}.memcached.failureMode=Redistribute
  671. # ${configurationKey}.memcached.hashAlgorithm=FNV1_64_HASH
  672. # ${configurationKey}.memcached.shouldOptimize=false
  673. # ${configurationKey}.memcached.daemon=true
  674. # ${configurationKey}.memcached.maxReconnectDelay=-1
  675. # ${configurationKey}.memcached.useNagleAlgorithm=false
  676. # ${configurationKey}.memcached.shutdownTimeoutSeconds=-1
  677. # ${configurationKey}.memcached.opTimeout=-1
  678. # ${configurationKey}.memcached.timeoutExceptionThreshold=2
  679. # ${configurationKey}.memcached.maxTotal=20
  680. # ${configurationKey}.memcached.maxIdle=8
  681. # ${configurationKey}.memcached.minIdle=0
  682. # ${configurationKey}.memcached.transcoder=KRYO|SERIAL|WHALIN|WHALINV1
  683. # ${configurationKey}.memcached.transcoderCompressionThreshold=16384
  684. # ${configurationKey}.memcached.kryoAutoReset=false
  685. # ${configurationKey}.memcached.kryoObjectsByReference=false
  686. # ${configurationKey}.memcached.kryoRegistrationRequired=false
  687. ```
  688. ## Password Policy Settings
  689. The following options are shared and apply when CAS is configured to integrate with account sources and authentication strategies that support password policy enforcement and detection, given the provider's *configuration key*. Note that certain setting may only be applicable if the underlying account source is LDAP and are only taken into account if the authentication strategy configured in CAS is able to honor and recognize them:
  690. ```properties
  691. # ${configurationKey}.type=GENERIC|AD|FreeIPA|EDirectory
  692. # ${configurationKey}.enabled=true
  693. # ${configurationKey}.policyAttributes.accountLocked=javax.security.auth.login.AccountLockedException
  694. # ${configurationKey}.loginFailures=5
  695. # ${configurationKey}.warningAttributeValue=
  696. # ${configurationKey}.warningAttributeName=
  697. # ${configurationKey}.displayWarningOnMatch=true
  698. # ${configurationKey}.warnAll=true
  699. # ${configurationKey}.warningDays=30
  700. # ${configurationKey}.accountStateHandlingEnabled=true
  701. # An implementation of `org.ldaptive.auth.AuthenticationResponseHandler`
  702. # ${configurationKey}.customPolicyClass=com.example.MyAuthenticationResponseHandler
  703. # ${configurationKey}.strategy=DEFAULT|GROOVY|REJECT_RESULT_CODE
  704. # ${configurationKey}.groovy.location=file:/etc/cas/config/password-policy.groovy
  705. ```
  706. #### Password Policy Strategies
  707. Password policy strategy types are outlined below. The strategy evaluates the authentication response received from LDAP, etc and is allowed to review it upfront in order to further examine whether account state, messages and warnings is eligible for further investigation.
  708. | Option | Description
  709. |---------------|-----------------------------------------------------------------------------
  710. | `DEFAULT` | Accepts the authentication response as is, and processes account state, if any.
  711. | `GROOVY` | Examine the authentication response as part of a Groovy script dynamically. The responsibility of handling account state changes and warnings is entirely delegated to the script.
  712. | `REJECT_RESULT_CODE` | An extension of the `DEFAULT` where account state is processed only if the result code of the authentication response is not blacklisted in the configuration. By default `INVALID_CREDENTIALS(49)` prevents CAS from handling account states.
  713. If the password policy strategy is to be handed off to a Groovy script, the outline of the script may be as follows:
  714. ```groovy
  715. import java.util.*
  716. import org.ldaptive.auth.*
  717. import org.apereo.cas.*
  718. import org.apereo.cas.authentication.*
  719. import org.apereo.cas.authentication.support.*
  720. def List<MessageDescriptor> run(final Object... args) {
  721. def response = args[0]
  722. def configuration = args[1];
  723. def logger = args[2]
  724. def applicationContext = args[3]
  725. logger.info("Handling password policy [{}] via ${configuration.getAccountStateHandler()}", response)
  726. def accountStateHandler = configuration.getAccountStateHandler()
  727. return accountStateHandler.handle(response, configuration)
  728. }
  729. ```
  730. The parameters passed are as follows:
  731. | Parameter | Description
  732. |-----------------------|-----------------------------------------------------------------------------------
  733. | `response` | The LDAP authentication response of type `org.ldaptive.auth.AuthenticationResponse`
  734. | `configuration` | The LDAP password policy configuration carrying the account state handler defined.
  735. | `logger` | The object responsible for issuing log messages such as `logger.info(...)`.
  736. ## Email Notifications
  737. To learn more about this topic, [please review this guide](../installation/Sending-Email-Configuration.html).
  738. The following options are shared and apply when CAS is configured to send email notifications, given the provider's *configuration key*:
  739. ```properties
  740. # ${configurationKey}.mail.from=
  741. # ${configurationKey}.mail.text=
  742. # ${configurationKey}.mail.subject=
  743. # ${configurationKey}.mail.cc=
  744. # ${configurationKey}.mail.bcc=
  745. # ${configurationKey}.mail.attributeName=mail
  746. ```
  747. The following settings may also need to be defined to describe the mail server settings:
  748. ```properties
  749. # spring.mail.host=
  750. # spring.mail.port=
  751. # spring.mail.username=
  752. # spring.mail.password=
  753. # spring.mail.testConnection=true
  754. # spring.mail.properties.mail.smtp.auth=true
  755. # spring.mail.properties.mail.smtp.starttls.enable=true
  756. ```
  757. ## SMS Notifications
  758. The following options are shared and apply when CAS is configured to send SMS notifications, given the provider's *configuration key*:
  759. ```properties
  760. # ${configurationKey}.sms.from=
  761. # ${configurationKey}.sms.text=
  762. # ${configurationKey}.sms.attributeName=phone
  763. ```
  764. You will also need to ensure a provider is defined that is able to send SMS messages. To learn more about this
  765. topic, [please review this guide](../installation/SMS-Messaging-Configuration.html).
  766. ## Delegated Authentication Settings
  767. The following options are shared and apply when CAS is configured to delegate authentication
  768. to an external provider such as Yahoo, given the provider's *configuration key*:
  769. ```properties
  770. # ${configurationKey}.id=
  771. # ${configurationKey}.secret=
  772. # ${configurationKey}.clientName=My Provider
  773. # ${configurationKey}.autoRedirect=false
  774. # ${configurationKey}.principalAttributeId=
  775. ```
  776. ### Delegated Authentication OpenID Connect Settings
  777. The following options are shared and apply when CAS is configured to delegate authentication
  778. to an external OpenID Connect provider such as Azure AD, given the provider's *configuration key*:
  779. ```properties
  780. # ${configurationKey}.discoveryUri=
  781. # ${configurationKey}.logoutUrl=
  782. # ${configurationKey}.maxClockSkew=
  783. # ${configurationKey}.scope=
  784. # ${configurationKey}.useNonce=
  785. # ${configurationKey}.preferredJwsAlgorithm=
  786. # ${configurationKey}.customParams.param1=value1
  787. ```
  788. ## LDAP Connection Settings
  789. The following options apply to features that integrate with an LDAP server (i.e. authentication, attribute resolution, etc) given the provider's *configuration key*:
  790. ```properties
  791. #${configurationKey}.ldapUrl=ldaps://ldap1.example.edu ldaps://ldap2.example.edu
  792. #${configurationKey}.bindDn=cn=Directory Manager,dc=example,dc=org
  793. #${configurationKey}.bindCredential=Password
  794. #${configurationKey}.poolPassivator=NONE|CLOSE|BIND
  795. #${configurationKey}.connectionStrategy=
  796. #${configurationKey}.providerClass=org.ldaptive.provider.unboundid.UnboundIDProvider
  797. #${configurationKey}.connectTimeout=PT5S
  798. #${configurationKey}.trustCertificates=
  799. #${configurationKey}.keystore=
  800. #${configurationKey}.keystorePassword=
  801. #${configurationKey}.keystoreType=JKS|JCEKS|PKCS12
  802. #${configurationKey}.minPoolSize=3
  803. #${configurationKey}.maxPoolSize=10
  804. #${configurationKey}.validateOnCheckout=true
  805. #${configurationKey}.validatePeriodically=true
  806. #${configurationKey}.validatePeriod=PT5M
  807. #${configurationKey}.validateTimeout=PT5S
  808. #${configurationKey}.failFast=true
  809. #${configurationKey}.idleTime=PT10M
  810. #${configurationKey}.prunePeriod=PT2H
  811. #${configurationKey}.blockWaitTime=PT3S
  812. #${configurationKey}.useSsl=true
  813. #${configurationKey}.useStartTls=false
  814. #${configurationKey}.responseTimeout=PT5S
  815. #${configurationKey}.allowMultipleDns=false
  816. #${configurationKey}.name=
  817. ```
  818. ### Connection Initialization
  819. LDAP connection configuration injected into the LDAP connection pool can be initialized with the following parameters:
  820. | Behavior | Description
  821. |----------------------------------------|-------------------------------------------------------------------
  822. | `bindDn`/`bindCredential` provided | Use the provided credentials to bind when initializing connections.
  823. | `bindDn`/`bindCredential` set to `*` | Use a fast-bind strategy to initialize the pool.
  824. | `bindDn`/`bindCredential` set to blank | Skip connection initializing; perform operations anonymously.
  825. | SASL mechanism provided | Use the given SASL mechanism to bind when initializing connections.
  826. ### Passivators
  827. The following options can be used to passivate objects when they are checked back into the LDAP connection pool:
  828. | Type | Description
  829. |-------------------------|----------------------------------------------------------------------------------------------------
  830. | `NONE` | No passivation takes place.
  831. | `CLOSE` | Passivates a connection by attempting to close it.
  832. | `BIND` | The default behavior which passivates a connection by performing a bind operation on it. This option requires the availability of bind credentials when establishing connections to LDAP.
  833. #### Why Passivators?
  834. You may receive unexpected LDAP failures, when CAS is configured to authenticate using `DIRECT` or `AUTHENTICATED` types and LDAP is locked down to not allow anonymous binds/searches. Every second attempt with a given LDAP connection from the pool would fail if it was on the same connection as a failed login attempt, and the regular connection validator would similarly fail. When a connection is returned back to a pool, it still may contain the principal and credentials from the previous attempt. Before the next bind attempt using that connection, the validator tries to validate the connection again but fails because it's no longer trying with the configured bind credentials but with whatever user DN was used in the previous step. Given the validation failure, the connection is closed and CAS would deny access by default. Passivators attempt to reconnect to LDAP with the configured bind credentials, effectively resetting the connection to what it should be after each bind request.
  835. Furthermore if you are seeing errors in the logs that resemble a *<Operation exception encountered, reopening connection>* type of message, this usually is an indication that the connection pool's validation timeout established and created by CAS is greater than the timeout configured in the LDAP server, or more likely, in the load balancer in front of the LDAP servers. You can adjust the LDAP server session's timeout for connections, or you can teach CAS to use a validity period that is equal or less than the LDAP server session's timeout.
  836. ### Connection Strategies
  837. If multiple URLs are provided as the LDAP url, this describes how each URL will be processed.
  838. | Provider | Description
  839. |-----------------------|-----------------------------------------------------------------------------------------------
  840. | `DEFAULT` | The default JNDI provider behavior will be used.
  841. | `ACTIVE_PASSIVE` | First LDAP will be used for every request unless it fails and then the next shall be used.
  842. | `ROUND_ROBIN` | For each new connection the next url in the list will be used.
  843. | `RANDOM` | For each new connection a random LDAP url will be selected.
  844. | `DNS_SRV` | LDAP urls based on DNS SRV records of the configured/given LDAP url will be used.
  845. ### LDAP SASL Mechanisms
  846. ```properties
  847. #${configurationKey}.saslMechanism=GSSAPI|DIGEST_MD5|CRAM_MD5|EXTERNAL
  848. #${configurationKey}.saslRealm=EXAMPLE.COM
  849. #${configurationKey}.saslAuthorizationId=
  850. #${configurationKey}.saslMutualAuth=
  851. #${configurationKey}.saslQualityOfProtection=
  852. #${configurationKey}.saslSecurityStrength=
  853. ```
  854. ### LDAP Connection Validators
  855. The following LDAP validators can be used to test connection health status:
  856. | Type | Description
  857. |-------------------------|----------------------------------------------------------------------------------------------------
  858. | `NONE` | No validation takes place.
  859. | `SEARCH` | Validates a connection is healthy by performing a search operation. Validation is considered successful if the search result size is greater than zero.
  860. | `COMPARE` | Validates a connection