-
Notifications
You must be signed in to change notification settings - Fork 26
Ticket ID generator based on host name
The default CAS ticket id generator, that is based on DefaultUniqueTicketIdGenerator
is configured to receive a suffix
parameter that is appended to generated ticket identifiers. This suffix
parameter is typically configured the key host.name
in the cas.properties
.
In multi-node CAS deployments, configuring the suffix
parameter to match individual host names, or at least identifiers that closely resemble the host name id is useful for troubleshooting and diagnostics purposes, such that an adopter through appropriate log files would be able to figure out the origins of a vended ticket. This then requires that various versions of the cas.properties
file for instance be kept around, each of which would include the unique identifier for the appropriate CAS node.
As of 1.7
, there exists a HostNameBasedUniqueTicketIdGenerator
that is able to auto-configure the ticket suffix based on the host name. The implementation carefully appends the first part of the host name to the ticket id, so as not moderately provide a relevant unique value mapped to the host name AND not leak infrastructure data out into the configuration and logs.
- If the CAS node name is
cas-01.sso.edu
then, the suffix determined would just becas-01
- If the CAS node name is
cas-01
then, the suffix determined would just becas-01
In uniqueIdGenerators.xml
, adjust the following settings:
<bean id="ticketGrantingTicketUniqueIdGenerator" class="net.unicon.cas.addons.ticket.internal.HostNameBasedUniqueTicketIdGenerator"
c:maxLength="50" />
<bean id="serviceTicketUniqueIdGenerator" class="net.unicon.cas.addons.ticket.internal.HostNameBasedUniqueTicketIdGenerator"
c:maxLength="20" />
<bean id="loginTicketUniqueIdGenerator" class="net.unicon.cas.addons.ticket.internal.HostNameBasedUniqueTicketIdGenerator"
c:maxLength="30" />
<bean id="proxy20TicketUniqueIdGenerator" class="net.unicon.cas.addons.ticket.internal.HostNameBasedUniqueTicketIdGenerator"
c:maxLength="20" />
Note: the auto-configuration of the suffix
is only activated if the suffix
parameter of the HostNameBasedUniqueTicketIdGenerator
is left blank.