Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

This page is a place to evolve a CAS 3 domain model for tickets.

Note
titleLegacy page

The content in this page is outdated. See instead Ticket module.

Discussion

The question we're asking is, "What's the proper relationship, in a class hierarchy used by CAS server implementation, between service tickets and proxy tickets?"

Code snippets

Code Block
titleTicket

public Interface Ticket {

   /**
    * Get the Date at which this Ticket was created.
    */
    public Date getTimestamp();


   /**
    * Returns true if this ticektticket asis valid, false otherwise.
    */
    public boolean isValid();

}

...

Panel
titleSSOTicket

Single Sign On tickets are tickets representing a particular user's single sign on session with CAS. They are TicketGrantingTickets but they are not DerivedTickets because their origin is not from another CAS ticket. They are not derived from another of the CAS 3 Ticket Domain Model tickets. Rather, they are derived from something external to the ticket domain model: the presentation and authentication of primary credentials.

Code Block
titleSSOTicket code sketch
public Class SSOTicket implements TicketGrantingTicket {

    private final Date whenCreated = new Date();

    private final Principal authenticatedUser;

    private final ExpirationPolicy expPolicy;

    private final ExpirationPolicyFactory expPolicyFactory;


    public SSOTicket(Principal authenticatedUser, 
        ExpirationPolicy expPolicy, 
        ExpirationPolicyFactory expPolicyFactory) {
       this.authenticatedUser = authenticatedUser;
       this.expPolicy = expPolicy;
       this.expPolicyFactory = expPolicyFactory;
    }

    public Principal getUser() {
       return this.authenticatedUser;
    }

    public boolean isValid() {
         return this.expPolicy.isValid();
    }

    public void expire() {
        this.expPolicy.expire();
    }

    public TargettedTicket deriveTicket(URL target) {

        return new TargettedTicketImpl(target, this, this.expPolicyFactory.buildPolicyInstance());

    }

}

...