Package 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 Object
Validates STs and optionally retrieves PGT IOUs. Designed with a bean-like interface for simplicity and generality.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classServiceTicketValidator.Handler
-
Field Summary
Fields Modifier and Type Field Description protected booleanattemptedAuthenticationprotected StringcasValidateUrlprotected StringentireResponseprotected StringerrorCodeprotected StringerrorMessageprotected StringpgtIouprotected StringproxyCallbackUrlprotected booleanrenewprotected Stringserviceprotected Stringstprotected booleansuccessfulAuthenticationprotected Stringuser
-
Constructor Summary
Constructors Constructor Description ServiceTicketValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclear()Clears internally manufactured state.StringgetCasValidateUrl()Gets the CAS validation URL to use when validating tickets and retrieving PGT IOUs.StringgetErrorCode()Returns CAS's error code if authentication failed.StringgetErrorMessage()Returns an error message if CAS authentication failed.StringgetPgtIou()Returns the PGT IOU returned by CAS.StringgetProxyCallbackUrl()Gets the callback URL, owned logically by the calling service, to receive the PGTid/PGTiou mapping.StringgetResponse()Retrieves CAS's entire response, if authentication was succsesful.StringgetUser()Returns the strongly authenticated username.booleanisAuthenticationSuccesful()Returnstrueif the most recent authentication attempted succeeded,falseotherwise.protected DefaultHandlernewHandler()voidsetCasValidateUrl(String x)Sets the CAS validation URL to use when validating tickets and retrieving PGT IOUs.voidsetProxyCallbackUrl(String x)Sets the callback URL, owned logically by the calling service, to receive the PGTid/PGTiou mapping.voidsetRenew(boolean b)Sets the "renew" flag on authentication.voidsetService(String x)Sets the service to use when validating.voidsetServiceTicket(String x)Sets the ST to validate.voidvalidate()
-
-
-
Field Detail
-
casValidateUrl
protected String casValidateUrl
-
proxyCallbackUrl
protected String proxyCallbackUrl
-
errorMessage
protected String errorMessage
-
entireResponse
protected String entireResponse
-
renew
protected boolean renew
-
attemptedAuthentication
protected boolean attemptedAuthentication
-
successfulAuthentication
protected boolean successfulAuthentication
-
-
Constructor Detail
-
ServiceTicketValidator
public ServiceTicketValidator()
-
-
Method Detail
-
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.
-
isAuthenticationSuccesful
public boolean isAuthenticationSuccesful()
Returnstrueif the most recent authentication attempted succeeded,falseotherwise.
-
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
-
newHandler
protected DefaultHandler newHandler()
-
clear
protected void clear()
Clears internally manufactured state.
-
-