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 class
ServiceTicketValidator.Handler
-
Field Summary
Fields Modifier and Type Field Description protected boolean
attemptedAuthentication
protected String
casValidateUrl
protected String
entireResponse
protected String
errorCode
protected String
errorMessage
protected String
pgtIou
protected String
proxyCallbackUrl
protected boolean
renew
protected String
service
protected String
st
protected boolean
successfulAuthentication
protected String
user
-
Constructor Summary
Constructors Constructor Description ServiceTicketValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
clear()
Clears internally manufactured state.String
getCasValidateUrl()
Gets the CAS validation URL to use when validating tickets and retrieving PGT IOUs.String
getErrorCode()
Returns CAS's error code if authentication failed.String
getErrorMessage()
Returns an error message if CAS authentication failed.String
getPgtIou()
Returns the PGT IOU returned by CAS.String
getProxyCallbackUrl()
Gets the callback URL, owned logically by the calling service, to receive the PGTid/PGTiou mapping.String
getResponse()
Retrieves CAS's entire response, if authentication was succsesful.String
getUser()
Returns the strongly authenticated username.boolean
isAuthenticationSuccesful()
Returnstrue
if the most recent authentication attempted succeeded,false
otherwise.protected DefaultHandler
newHandler()
void
setCasValidateUrl(String x)
Sets the CAS validation URL to use when validating tickets and retrieving PGT IOUs.void
setProxyCallbackUrl(String x)
Sets the callback URL, owned logically by the calling service, to receive the PGTid/PGTiou mapping.void
setRenew(boolean b)
Sets the "renew" flag on authentication.void
setService(String x)
Sets the service to use when validating.void
setServiceTicket(String x)
Sets the ST to validate.void
validate()
-
-
-
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()
Returnstrue
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
-
newHandler
protected DefaultHandler newHandler()
-
clear
protected void clear()
Clears internally manufactured state.
-
-