edu.yale.its.tp.cas.client
Class ServiceTicketValidator

java.lang.Object
  |
  +--edu.yale.its.tp.cas.client.ServiceTicketValidator
Direct Known Subclasses:
ProxyTicketValidator

public class ServiceTicketValidator
extends java.lang.Object

Validates STs and optionally retrieves PGT IOUs. Designed with a bean-like interface for simplicity and generality.


Nested Class Summary
protected  class ServiceTicketValidator.Handler
           
 
Constructor Summary
ServiceTicketValidator()
           
 
Method Summary
protected  void clear()
          Clears internally manufactured state.
 java.lang.String getCasValidateUrl()
          Gets the CAS validation URL to use when validating tickets and retrieving PGT IOUs.
 java.lang.String getErrorCode()
          Returns CAS's error code if authentication failed.
 java.lang.String getErrorMessage()
          Returns an error message if CAS authentication failed.
 java.lang.String getPgtIou()
          Returns the PGT IOU returned by CAS.
 java.lang.String getProxyCallbackUrl()
          Gets the callback URL, owned logically by the calling service, to receive the PGTid/PGTiou mapping.
 java.lang.String getResponse()
          Retrieves CAS's entire response, if authentication was succsesful.
 java.lang.String getUser()
          Returns the strongly authenticated username.
 boolean isAuthenticationSuccesful()
          Returns true if the most recent authentication attempted succeeded, false otherwise.
static void main(java.lang.String[] args)
           
protected  org.xml.sax.helpers.DefaultHandler newHandler()
           
 void setCasValidateUrl(java.lang.String x)
          Sets the CAS validation URL to use when validating tickets and retrieving PGT IOUs.
 void setProxyCallbackUrl(java.lang.String x)
          Sets the callback URL, owned logically by the calling service, to receive the PGTid/PGTiou mapping.
 void setService(java.lang.String x)
          Sets the service to use when validating.
 void setServiceTicket(java.lang.String x)
          Sets the ST to validate.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceTicketValidator

public ServiceTicketValidator()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exception

setCasValidateUrl

public void setCasValidateUrl(java.lang.String x)
Sets the CAS validation URL to use when validating tickets and retrieving PGT IOUs.


getCasValidateUrl

public java.lang.String getCasValidateUrl()
Gets the CAS validation URL to use when validating tickets and retrieving PGT IOUs.


setProxyCallbackUrl

public void setProxyCallbackUrl(java.lang.String x)
Sets the callback URL, owned logically by the calling service, to receive the PGTid/PGTiou mapping.


getProxyCallbackUrl

public java.lang.String getProxyCallbackUrl()
Gets the callback URL, owned logically by the calling service, to receive the PGTid/PGTiou mapping.


setServiceTicket

public void setServiceTicket(java.lang.String x)
Sets the ST to validate.


setService

public void setService(java.lang.String x)
Sets the service to use when validating.


getUser

public java.lang.String getUser()
Returns the strongly authenticated username.


getPgtIou

public java.lang.String getPgtIou()
Returns the PGT IOU returned by CAS.


isAuthenticationSuccesful

public boolean isAuthenticationSuccesful()
Returns true if the most recent authentication attempted succeeded, false otherwise.


getErrorMessage

public java.lang.String getErrorMessage()
Returns an error message if CAS authentication failed.


getErrorCode

public java.lang.String getErrorCode()
Returns CAS's error code if authentication failed.


getResponse

public java.lang.String getResponse()
Retrieves CAS's entire response, if authentication was succsesful.


validate

public void validate()
              throws java.io.IOException,
                     org.xml.sax.SAXException,
                     javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException

newHandler

protected org.xml.sax.helpers.DefaultHandler newHandler()

clear

protected void clear()
Clears internally manufactured state.