JWT Service Tickets
JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties. CAS may also be allowed to fully create signed/encrypted JWTs and pass them back to the application in form of service tickets.
JWTs are entirely self-contained and contain the authenticated principal as well as all authorized attributes in form of JWT claims.
Make sure you have the proper JCE bundle installed in your Java
environment that is used by CAS, specially if you need to use specific signing/encryption algorithms and methods. Be sure to pick
the right version of the JCE for your Java version. Java versions can be detected via the java -version
command.
Overview
JWT-based service tickets are issued to application based on the same semantics defined by the CAS Protocol.
CAS having received an authentication request via its /login
endpoint will conditionally issue back JWT
service tickets to the
application in form of a ticket
parameter via the requested http method.
All JWTs are by default signed and encrypted by CAS based on keys generated and controlled during deployment. Such keys may be exchanged with client applications to unpack the JWT and access claims.
Flow Diagram
Note that per the above diagram, the JWT request by default internally causes CAS to generate an ST
for the application and immediately then validate it in
order to get access to the authenticated principal and attributes per policies associated with the application registration record in the
CAS service registry. This response is transformed into a JWT
that is then passed onto the client application.
In other words, the responsibility of receiving a service ticket (ST
) and validating it is all moved into and handled internally by CAS.
The application only needs to learn how to decipher and unpack the final JWT
and ensure its validity.
The expiration time of the generated JWT
is controlled by the length of the assertion returned as part of the validation event. If the
assertion validity length is not specified, then the expiration time is controlled by the length of the SSO session defined as part of SSO expiration policy of the CAS server.
Remember that you are just receiving a ticket in form of a JWT, thereby removing the need from your client to validate a normal service ticket. The ticket is internally validated by CAS and you as the client are only left in charge of validating the JWT itself. Do not confuse this with OpenID Connect. While a JWT, the token itself is not an ID token, cannot be refreshed and must be obtained again once you deem it expired. If you need more, consider using the OpenID Connect protocol instead. Note that the responsibility of validating the JWT is pushed onto the client and NOT the CAS server itself.
Actuator Endpoints
The following endpoints are provided by CAS:
The following settings and properties are available from the CAS configuration catalog:
- Required
- Optional
- Signing & Encryption
- Hibernate & JDBC
- Email Servers
- LDAP & Active Directory
- Authentication
- Password Encoding
- Principal Transformation
- Password Policy
cas.monitor.endpoints.jdbc.password-encoder.encoding-algorithm=
The encoding algorithm to use such as |
cas.monitor.endpoints.jdbc.password-encoder.type=NONE
Define the password encoder type to use. Type may be specified as blank or
|
cas.monitor.endpoints.jdbc.driver-class=org.hsqldb.jdbcDriver
The JDBC driver used to connect to the database. |
cas.monitor.endpoints.jdbc.password=
The database connection password. |
cas.monitor.endpoints.jdbc.url=jdbc:hsqldb:mem:cas-hsql-database
The database connection URL. This setting supports the Spring Expression Language. |
cas.monitor.endpoints.jdbc.user=sa
The database user. The database user must have sufficient permissions to be able to handle schema changes and updates, when needed. |
cas.monitor.endpoints.jdbc.password-encoder.character-encoding=UTF-8
The encoding algorithm to use such as 'UTF-8'. Relevant when the type used is |
cas.monitor.endpoints.jdbc.password-encoder.hash-length=16
When used by |
cas.monitor.endpoints.jdbc.password-encoder.secret=
Secret to use with |
cas.monitor.endpoints.jdbc.password-encoder.strength=16
Strength or number of iterations to use for password hashing. Usually relevant when dealing with |
cas.monitor.endpoints.jdbc.autocommit=false
The default auto-commit behavior of connections in the pool. Determined whether queries such as update/insert should be immediately executed without waiting for an underlying transaction. |
cas.monitor.endpoints.jdbc.batch-size=100
A non-zero value enables use of JDBC2 batch updates by Hibernate. e.g. recommended values between 5 and 30. |
cas.monitor.endpoints.jdbc.data-source-name=
Attempts to do a JNDI data source look up for the data source name specified. Will attempt to locate the data source object as is. |
cas.monitor.endpoints.jdbc.ddl-auto=update
Hibernate feature to automatically validate and exports DDL to the schema. By default, creates and drops the schema automatically when a session is starts and ends. Setting the value to
create-drop will result in the loss of all data as soon as CAS is started. For transient data like tickets this is probably not an issue, but in cases like the audit table important data could be lost. Using `update`, while safe for data, is confirmed to result in invalid database state. validate or none settings are likely the only safe options for production use. For more info, see this.
|
cas.monitor.endpoints.jdbc.default-catalog=
Qualifies unqualified table names with the given catalog in generated SQL. |
cas.monitor.endpoints.jdbc.default-schema=
Qualify unqualified table names with the given schema/tablespace in generated SQL. |
cas.monitor.endpoints.jdbc.dialect=org.hibernate.dialect.HSQLDialect
The database dialect is a configuration setting for platform independent software (JPA, Hibernate, etc) which allows such software to translate its generic SQL statements into vendor specific DDL, DML. |
cas.monitor.endpoints.jdbc.fail-fast-timeout=1
Set the pool initialization failure timeout.
connectionTimeout or validationTimeout ; they will be honored before this timeout is applied. The default value is one millisecond.
|
cas.monitor.endpoints.jdbc.fetch-size=100
Used to specify number of rows to be fetched in a select query. |
cas.monitor.endpoints.jdbc.generate-statistics=false
Allow hibernate to generate query statistics. |
cas.monitor.endpoints.jdbc.health-query=
The SQL query to be executed to test the validity of connections. This is for "legacy" databases that do not support the JDBC4 |
cas.monitor.endpoints.jdbc.idle-timeout=PT10M
Controls the maximum amount of time that a connection is allowed to sit idle in the pool. This settings supports the
|
cas.monitor.endpoints.jdbc.isolate-internal-queries=false
This property determines whether data source isolates internal pool queries, such as the connection alive test, in their own transaction. Since these are typically read-only queries, it is rarely necessary to encapsulate them in their own transaction. This property only applies if#autocommit is disabled.
|
cas.monitor.endpoints.jdbc.isolation-level-name=ISOLATION_READ_COMMITTED
Defines the isolation level for transactions. @see org.springframework.transaction.TransactionDefinition |
cas.monitor.endpoints.jdbc.leak-threshold=3000
Controls the amount of time that a connection can be out of the pool before a message is logged indicating a possible connection leak. |
cas.monitor.endpoints.jdbc.physical-naming-strategy-class-name=org.apereo.cas.hibernate.CasHibernatePhysicalNamingStrategy
Fully-qualified name of the class that can control the physical naming strategy of hibernate. |
cas.monitor.endpoints.jdbc.propagation-behavior-name=PROPAGATION_REQUIRED
Defines the propagation behavior for transactions. @see org.springframework.transaction.TransactionDefinition |
cas.monitor.endpoints.jdbc.properties=
Additional settings provided by Hibernate (or the connection provider) in form of key-value pairs. |
cas.monitor.endpoints.jdbc.query=
Query to execute in order to authenticate users via JDBC. Example: |
cas.monitor.endpoints.jdbc.read-only=false
Configures the Connections to be added to the pool as read-only Connections. |
cas.monitor.endpoints.jdbc.role-prefix=
Prefix to add to the role. |
cas.monitor.endpoints.jdbc.pool.keep-alive-time=0
This property controls the keepalive interval for a connection in the pool. An in-use connection will never be tested by the keepalive thread, only when it is idle will it be tested. Default is zero, which disables this feature. This settings supports the
|
cas.monitor.endpoints.jdbc.pool.max-size=18
Controls the maximum number of connections to keep in the pool, including both idle and in-use connections. |
cas.monitor.endpoints.jdbc.pool.max-wait=PT2S
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout. This settings supports the
|
cas.monitor.endpoints.jdbc.pool.maximum-lifetime=PT10M
This property controls the maximum lifetime of a connection in the pool. When a connection reaches this timeout, even if recently used, it will be retired from the pool. An in-use connection will never be retired, only when it is idle will it be removed. This settings supports the
|
cas.monitor.endpoints.jdbc.pool.min-size=6
Controls the minimum size that the pool is allowed to reach, including both idle and in-use connections. |
cas.monitor.endpoints.jdbc.pool.name=
Set the name of the connection pool. This is primarily used for the MBean to uniquely identify the pool configuration. |
cas.monitor.endpoints.jdbc.pool.suspension=false
Whether or not pool suspension is allowed. There is a performance impact when pool suspension is enabled. Unless you need it (for a redundancy system for example) do not enable it. |
cas.monitor.endpoints.jdbc.pool.timeout-millis=1000
The maximum number of milliseconds that the pool will wait for a connection to be validated as alive. |