Embedded Servlet Container
Note that CAS itself ships with a number of embedded containers that allow the platform to be self-contained as much as possible. These embedded containers are an integral part of the CAS software, are maintained and updated usually for every release and surely are meant to and can be used in production deployments. You DO NOT need to, but can if you want to, configure and deploy to an externally configured container.
Configuration
The following settings and properties are available from the CAS configuration catalog:
server.connection-timeout
server.portServer HTTP port.
8080Server HTTP port.
server.servlet.application-display-nameDisplay name of the application.
applicationDisplay name of the application.
server.servlet.context-parametersServlet context init parameters.
Servlet context init parameters.
server.servlet.context-pathContext path of the application.
Context path of the application.
server.servlet.encoding.charsetCharset of HTTP requests and responses.
Charset of HTTP requests and responses. Added to the Content-Type header if not set explicitly.
server.servlet.encoding.enabledWhether to enable http encoding support.
trueWhether to enable http encoding support.
server.servlet.encoding.forceWhether to force the encoding to the configured charset on HTTP requests and responses.
falseWhether to force the encoding to the configured charset on HTTP requests and responses.
server.servlet.encoding.force-requestWhether to force the encoding to the configured charset on HTTP requests.
trueWhether to force the encoding to the configured charset on HTTP requests. Defaults to true when force has not been specified.
server.servlet.encoding.force-responseWhether to force the encoding to the configured charset on HTTP responses.
falseWhether to force the encoding to the configured charset on HTTP responses.
server.servlet.encoding.mappingMapping of locale to charset for response encoding.
Mapping of locale to charset for response encoding.
server.servlet.jsp.class-nameClass name of the servlet to use for JSPs.
org.apache.jasper.servlet.JspServletClass name of the servlet to use for JSPs. If registered is true and this class * is on the classpath then it will be registered.
server.servlet.jsp.init-parametersInit parameters used to configure the JSP servlet.
Init parameters used to configure the JSP servlet.
server.servlet.jsp.registeredWhether the JSP servlet is registered.
trueWhether the JSP servlet is registered.
server.servlet.pathPath of the main dispatcher servlet.
/Path of the main dispatcher servlet.
server.servlet.register-default-servletWhether to register the default Servlet with the container.
falseWhether to register the default Servlet with the container.
server.servlet.session.cookie.commentComment for the cookie.
Comment for the cookie.
server.servlet.session.cookie.domainDomain for the cookie.
Domain for the cookie.
server.servlet.session.cookie.http-onlyWhether to use "HttpOnly" cookies for the cookie.
Whether to use "HttpOnly" cookies for the cookie.
server.servlet.session.cookie.max-ageMaximum age of the cookie.
Maximum age of the cookie. If a duration suffix is not specified, seconds will be used. A positive value indicates when the cookie expires relative to the current time. A value of 0 means the cookie should expire immediately. A negative value means no "Max-Age".
server.servlet.session.cookie.nameName for the cookie.
Name for the cookie.
server.servlet.session.cookie.partitionedWhether the generated cookie carries the Partitioned attribute.
Whether the generated cookie carries the Partitioned attribute.
server.servlet.session.cookie.pathPath of the cookie.
Path of the cookie.
server.servlet.session.cookie.same-siteSameSite setting for the cookie.
SameSite setting for the cookie.
server.servlet.session.cookie.secureWhether to always mark the cookie as secure.
Whether to always mark the cookie as secure.
server.servlet.session.persistentWhether to persist session data between restarts.
falseWhether to persist session data between restarts.
server.servlet.session.store-dirDirectory used to store session data.
Directory used to store session data.
server.servlet.session.timeoutSession timeout.
30mSession timeout. If a duration suffix is not specified, seconds will be used.
server.servlet.session.tracking-modesSession tracking modes.
Session tracking modes.
server.ssl.bundleName of a configured SSL bundle.
Name of a configured SSL bundle.
server.ssl.certificatePath to a PEM-encoded SSL certificate file.
Path to a PEM-encoded SSL certificate file.
server.ssl.certificate-private-keyPath to a PEM-encoded private key file for the SSL certificate.
Path to a PEM-encoded private key file for the SSL certificate.
server.ssl.ciphersSupported SSL ciphers.
Supported SSL ciphers.
server.ssl.client-authClient authentication mode.
Client authentication mode. Requires a trust store.
server.ssl.enabledWhether to enable SSL support.
trueWhether to enable SSL support.
server.ssl.enabled-protocolsEnabled SSL protocols.
Enabled SSL protocols.
server.ssl.key-aliasAlias that identifies the key in the key store.
Alias that identifies the key in the key store.
server.ssl.key-passwordPassword used to access the key in the key store.
Password used to access the key in the key store.
server.ssl.key-storePath to the key store that holds the SSL certificate (typically a jks file).
Path to the key store that holds the SSL certificate (typically a jks file).
server.ssl.key-store-passwordPassword used to access the key store.
Password used to access the key store.
server.ssl.key-store-providerProvider for the key store.
Provider for the key store.
server.ssl.key-store-typeType of the key store.
Type of the key store.
server.ssl.protocolSSL protocol to use.
TLSSSL protocol to use.
server.ssl.server-name-bundlesMapping of host names to SSL bundles for SNI configuration.
Mapping of host names to SSL bundles for SNI configuration.
server.ssl.trust-certificatePath to a PEM-encoded SSL certificate authority file.
Path to a PEM-encoded SSL certificate authority file.
server.ssl.trust-certificate-private-keyPath to a PEM-encoded private key file for the SSL certificate authority.
Path to a PEM-encoded private key file for the SSL certificate authority.
server.ssl.trust-storeTrust store that holds SSL certificates.
Trust store that holds SSL certificates.
server.ssl.trust-store-passwordPassword used to access the trust store.
Password used to access the trust store.
server.ssl.trust-store-providerProvider for the trust store.
Provider for the trust store.
server.ssl.trust-store-typeType of the trust store.
Type of the trust store.
server.use-forward-headers
Required settings may be needed to activate or affect the feature; review them even when they have a default. Optional settings only need to be set to change a default or to turn on the behavior they control. Third party settings belong to libraries such as Spring Boot that CAS builds on; their own documentation may have more detail.
Notes on configuration
Configuration Metadata
The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.
Be Selective
This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.
YAGNI
Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.
Naming Convention
Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all
forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where
this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those
that might be presented to the system via an external library or framework such as Spring Boot, etc.
When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value.
The only possible exception to this rule is when naming actuator endpoints; The name of the
actuator endpoints (i.e. ssoSessions) MUST remain in camelCase mode.
Settings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided
to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with
the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition
or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the
way you intend.
Validation
Configuration properties are automatically validated on CAS startup to report issues with configuration binding, especially if defined CAS settings cannot be recognized or validated by the configuration schema. Additional validation processes are also handled via Configuration Metadata and property migrations applied automatically on startup by Spring Boot and family.
Indexed Settings
CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be
incremented by the adopter to allow for distinct multiple configuration blocks.
Execution
The CAS web application, once built, may be deployed in place with the embedded container via the following command:
1
java -jar /path/to/cas.war
Additionally, it is also possible to run CAS as a fully executable web application:
1
2
# chmod +x /path/to/cas.war
/path/to/cas.war
This is achieved via the build process of the deployment overlay where a launch script is inserted at the beginning of the web application artifact. If you wish to see and examine the script, run the following commands:
1
2
# X is the number of lines from the beginning of the file
head -n X /path/to.cas.war
Note that running CAS as a standalone and fully executable web application is supported on most Linux and OS X distributions. Other platforms such as Windows may require custom configuration.
The following embedded servlet containers are available:
| Option | Reference |
|---|---|
| Apache Tomcat | Please see this guide. |
| Jetty | Please see this guide. |