Class ServiceTicketValidator

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

public class ServiceTicketValidator extends Object
Validates STs and optionally retrieves PGT IOUs. Designed with a bean-like interface for simplicity and generality.
  • Field Details

    • casValidateUrl

      protected String casValidateUrl
    • proxyCallbackUrl

      protected String proxyCallbackUrl
    • st

      protected String st
    • service

      protected String service
    • pgtIou

      protected String pgtIou
    • user

      protected String user
    • errorCode

      protected String errorCode
    • errorMessage

      protected String errorMessage
    • entireResponse

      protected String entireResponse
    • renew

      protected boolean renew
    • attemptedAuthentication

      protected boolean attemptedAuthentication
    • successfulAuthentication

      protected boolean successfulAuthentication
  • Constructor Details

    • ServiceTicketValidator

      public ServiceTicketValidator()
  • Method Details

    • setCasValidateUrl

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

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

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

      public void setRenew(boolean b)
      Sets the "renew" flag on authentication. When set to "true", authentication will only succeed if this was an initial login (forced by the "renew" flag being set on login).
    • getProxyCallbackUrl

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

      public void setServiceTicket(String x)
      Sets the ST to validate.
    • setService

      public void setService(String x)
      Sets the service to use when validating.
    • getUser

      public String getUser()
      Returns the strongly authenticated username.
    • getPgtIou

      public 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 String getErrorMessage()
      Returns an error message if CAS authentication failed.
    • getErrorCode

      public String getErrorCode()
      Returns CAS's error code if authentication failed.
    • getResponse

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

      public void validate() throws IOException, SAXException, ParserConfigurationException
      Throws:
      IOException
      SAXException
      ParserConfigurationException
    • newHandler

      protected DefaultHandler newHandler()
    • clear

      protected void clear()
      Clears internally manufactured state.