Skip to content
This repository has been archived by the owner on Nov 3, 2017. It is now read-only.

Ticket ID generator based on host name

Misagh Moayyed edited this page Jul 23, 2013 · 3 revisions

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 be cas-01
  • If the CAS node name is cas-01 then, the suffix determined would just be cas-01

Configuration

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.

Clone this wiki locally