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
no default
Third partyDeprecated
Type
Duration
Default
none
Deprecation
ERROR, no replacement
server.portServer HTTP port.
8080
Third party

Server HTTP port.

Type
Integer
Default
8080
Defined by
ServerProperties
server.servlet.application-display-nameDisplay name of the application.
application
Third party

Display name of the application.

Type
String
Default
application
Defined by
ServerProperties$Servlet
server.servlet.context-parametersServlet context init parameters.
no default
Third party

Servlet context init parameters.

Type
Map<String,String>
Default
none
Defined by
ServerProperties$Servlet
server.servlet.context-pathContext path of the application.
no default
Third party

Context path of the application.

Type
String
Default
none
Defined by
ServerProperties$Servlet
server.servlet.encoding.charsetCharset of HTTP requests and responses.
no default
Third partyDeprecated

Charset of HTTP requests and responses. Added to the Content-Type header if not set explicitly.

Type
Charset
Default
none
Deprecation
ERROR, replaced by spring.servlet.encoding.charset
server.servlet.encoding.enabledWhether to enable http encoding support.
true
Third partyDeprecated

Whether to enable http encoding support.

Type
Boolean
Default
true
Deprecation
ERROR, replaced by spring.servlet.encoding.enabled
server.servlet.encoding.forceWhether to force the encoding to the configured charset on HTTP requests and responses.
false
Third partyDeprecated

Whether to force the encoding to the configured charset on HTTP requests and responses.

Type
Boolean
Default
false
Deprecation
ERROR, replaced by spring.servlet.encoding.force
server.servlet.encoding.force-requestWhether to force the encoding to the configured charset on HTTP requests.
true
Third partyDeprecated

Whether to force the encoding to the configured charset on HTTP requests. Defaults to true when force has not been specified.

Type
Boolean
Default
true
Deprecation
ERROR, replaced by spring.servlet.encoding.force-request
server.servlet.encoding.force-responseWhether to force the encoding to the configured charset on HTTP responses.
false
Third partyDeprecated

Whether to force the encoding to the configured charset on HTTP responses.

Type
Boolean
Default
false
Deprecation
ERROR, replaced by spring.servlet.encoding.force-response
server.servlet.encoding.mappingMapping of locale to charset for response encoding.
no default
Third party

Mapping of locale to charset for response encoding.

Type
Map<Locale,Charset>
Default
none
Defined by
ServerProperties$Encoding
server.servlet.jsp.class-nameClass name of the servlet to use for JSPs.
org.apache.jasper.servlet.JspServlet
Third party

Class name of the servlet to use for JSPs. If registered is true and this class * is on the classpath then it will be registered.

Type
String
Default
org.apache.jasper.servlet.JspServlet
Defined by
Jsp
server.servlet.jsp.init-parametersInit parameters used to configure the JSP servlet.
no default
Third party

Init parameters used to configure the JSP servlet.

Type
Map<String,String>
Default
none
Defined by
Jsp
server.servlet.jsp.registeredWhether the JSP servlet is registered.
true
Third party

Whether the JSP servlet is registered.

Type
Boolean
Default
true
Defined by
Jsp
server.servlet.pathPath of the main dispatcher servlet.
/
Third partyDeprecated

Path of the main dispatcher servlet.

Type
String
Default
/
Deprecation
ERROR, replaced by spring.mvc.servlet.path
server.servlet.register-default-servletWhether to register the default Servlet with the container.
false
Third party

Whether to register the default Servlet with the container.

Type
Boolean
Default
false
Defined by
ServerProperties$Servlet
server.servlet.session.cookie.commentComment for the cookie.
no default
Third partyDeprecated

Comment for the cookie.

Default
none
Deprecation
ERROR, no replacement
server.servlet.session.cookie.domainDomain for the cookie.
no default
Third party

Domain for the cookie.

Type
String
Default
none
Defined by
Cookie
server.servlet.session.cookie.http-onlyWhether to use "HttpOnly" cookies for the cookie.
no default
Third party

Whether to use "HttpOnly" cookies for the cookie.

Type
Boolean
Default
none
Defined by
Cookie
server.servlet.session.cookie.max-ageMaximum age of the cookie.
no default
Third party

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".

Type
Duration
Default
none
Defined by
Cookie
server.servlet.session.cookie.nameName for the cookie.
no default
Third party

Name for the cookie.

Type
String
Default
none
Defined by
Cookie
server.servlet.session.cookie.partitionedWhether the generated cookie carries the Partitioned attribute.
no default
Third party

Whether the generated cookie carries the Partitioned attribute.

Type
Boolean
Default
none
Defined by
Cookie
server.servlet.session.cookie.pathPath of the cookie.
no default
Third party

Path of the cookie.

Type
String
Default
none
Defined by
Cookie
server.servlet.session.cookie.same-siteSameSite setting for the cookie.
no default
Third party

SameSite setting for the cookie.

Type
Cookie.SameSite
Default
none
Defined by
Cookie
server.servlet.session.cookie.secureWhether to always mark the cookie as secure.
no default
Third party

Whether to always mark the cookie as secure.

Type
Boolean
Default
none
Defined by
Cookie
server.servlet.session.persistentWhether to persist session data between restarts.
false
Third party

Whether to persist session data between restarts.

Type
Boolean
Default
false
Defined by
Session
server.servlet.session.store-dirDirectory used to store session data.
no default
Third party

Directory used to store session data.

Type
File
Default
none
Defined by
Session
server.servlet.session.timeoutSession timeout.
30m
Third party

Session timeout. If a duration suffix is not specified, seconds will be used.

Type
Duration
Default
30m
Defined by
Session
server.servlet.session.tracking-modesSession tracking modes.
no default
Third party

Session tracking modes.

Type
Set<Session.SessionTrackingMode>
Default
none
Defined by
Session
server.ssl.bundleName of a configured SSL bundle.
no default
Third party

Name of a configured SSL bundle.

Type
String
Default
none
Defined by
Ssl
server.ssl.certificatePath to a PEM-encoded SSL certificate file.
no default
Third party

Path to a PEM-encoded SSL certificate file.

Type
String
Default
none
Defined by
Ssl
server.ssl.certificate-private-keyPath to a PEM-encoded private key file for the SSL certificate.
no default
Third party

Path to a PEM-encoded private key file for the SSL certificate.

Type
String
Default
none
Defined by
Ssl
server.ssl.ciphersSupported SSL ciphers.
no default
Third party

Supported SSL ciphers.

Type
String[]
Default
none
Defined by
Ssl
server.ssl.client-authClient authentication mode.
no default
Third party

Client authentication mode. Requires a trust store.

Type
Ssl.ClientAuth
Default
none
Defined by
Ssl
server.ssl.enabledWhether to enable SSL support.
true
Third party

Whether to enable SSL support.

Type
Boolean
Default
true
Defined by
Ssl
server.ssl.enabled-protocolsEnabled SSL protocols.
no default
Third party

Enabled SSL protocols.

Type
String[]
Default
none
Defined by
Ssl
server.ssl.key-aliasAlias that identifies the key in the key store.
no default
Third party

Alias that identifies the key in the key store.

Type
String
Default
none
Defined by
Ssl
server.ssl.key-passwordPassword used to access the key in the key store.
no default
Third party

Password used to access the key in the key store.

Type
String
Default
none
Defined by
Ssl
server.ssl.key-storePath to the key store that holds the SSL certificate (typically a jks file).
no default
Third party

Path to the key store that holds the SSL certificate (typically a jks file).

Type
String
Default
none
Defined by
Ssl
server.ssl.key-store-passwordPassword used to access the key store.
no default
Third party

Password used to access the key store.

Type
String
Default
none
Defined by
Ssl
server.ssl.key-store-providerProvider for the key store.
no default
Third party

Provider for the key store.

Type
String
Default
none
Defined by
Ssl
server.ssl.key-store-typeType of the key store.
no default
Third party

Type of the key store.

Type
String
Default
none
Defined by
Ssl
server.ssl.protocolSSL protocol to use.
TLS
Third party

SSL protocol to use.

Type
String
Default
TLS
Defined by
Ssl
server.ssl.server-name-bundlesMapping of host names to SSL bundles for SNI configuration.
no default
Third party

Mapping of host names to SSL bundles for SNI configuration.

Type
List<Ssl.ServerNameSslBundle>
Default
none
Defined by
Ssl
server.ssl.trust-certificatePath to a PEM-encoded SSL certificate authority file.
no default
Third party

Path to a PEM-encoded SSL certificate authority file.

Type
String
Default
none
Defined by
Ssl
server.ssl.trust-certificate-private-keyPath to a PEM-encoded private key file for the SSL certificate authority.
no default
Third party

Path to a PEM-encoded private key file for the SSL certificate authority.

Type
String
Default
none
Defined by
Ssl
server.ssl.trust-storeTrust store that holds SSL certificates.
no default
Third party

Trust store that holds SSL certificates.

Type
String
Default
none
Defined by
Ssl
server.ssl.trust-store-passwordPassword used to access the trust store.
no default
Third party

Password used to access the trust store.

Type
String
Default
none
Defined by
Ssl
server.ssl.trust-store-providerProvider for the trust store.
no default
Third party

Provider for the trust store.

Type
String
Default
none
Defined by
Ssl
server.ssl.trust-store-typeType of the trust store.
no default
Third party

Type of the trust store.

Type
String
Default
none
Defined by
Ssl
server.use-forward-headers
no default
Third partyDeprecated
Type
Boolean
Default
none
Deprecation
ERROR, replaced by server.forward-headers-strategy

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.

:information_source: Note

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.