Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleTicketGrantingTicket

public Interface TicketGrantingTicket 
    extends Ticket {

   /**
    * Get the Principal which owns this TicketGrantingTicket and may exercise it
    * to obtain a TargettedTicket for authentication to a particular URL. 
    * For instance, in the case of a SSOTicket this Principal is the end user who authenticated
    * to CAS by presentation of Primary Credentials.
    * In the case of a ProxyGrantingTicket, this is the URL to which the PGT was vended.
    */
    public Principal getPrincipal();


   /**
    * Derive from this TicketGrantingTicket a TargettedTicket for use in authenticating
    * to some particular target.
    */
    public TargettedTicket deriveTicket(URL target);

}

Panel
titleSSOTicket

Single Sign On tickets are tickets representing a particular user's single sign on session with CAS.

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());

    }

}

...