public abstract class AbstractUrlBasedTicketValidator extends Object implements TicketValidator
Modifier and Type | Field and Description |
---|---|
protected HostnameVerifier |
hostnameVerifier
Hostname verifier used when making an SSL request to the CAS server.
|
protected org.apache.commons.logging.Log |
log
Commons Logging instance.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractUrlBasedTicketValidator(String casServerUrlPrefix)
Constructs a new TicketValidator with the casServerUrlPrefix.
|
Modifier and Type | Method and Description |
---|---|
protected String |
constructValidationUrl(String ticket,
String serviceUrl)
Constructs the URL to send the validation request to.
|
protected String |
encodeUrl(String url)
Encodes a URL using the URLEncoder format.
|
protected String |
getEncoding() |
protected abstract String |
getUrlSuffix()
The endpoint of the validation URL.
|
protected abstract Assertion |
parseResponseFromServer(String response)
Parses the response from the server into a CAS Assertion.
|
protected void |
populateUrlAttributeMap(Map<String,String> urlParameters)
Template method for ticket validators that need to provide additional parameters to the validation url.
|
protected abstract String |
retrieveResponseFromServer(URL validationUrl,
String ticket)
Contacts the CAS Server to retrieve the response for the ticket validation.
|
void |
setCustomParameters(Map<String,String> customParameters) |
protected abstract void |
setDisableXmlSchemaValidation(boolean disabled)
Disable XML Schema validation.
|
void |
setEncoding(String encoding) |
void |
setHostnameVerifier(HostnameVerifier verifier) |
void |
setRenew(boolean renew) |
Assertion |
validate(String ticket,
String service)
Attempts to validate a ticket for the provided service.
|
protected final org.apache.commons.logging.Log log
protected HostnameVerifier hostnameVerifier
protected AbstractUrlBasedTicketValidator(String casServerUrlPrefix)
casServerUrlPrefix
- the location of the CAS server.protected void populateUrlAttributeMap(Map<String,String> urlParameters)
urlParameters
- the map containing the parameters.protected abstract String getUrlSuffix()
protected abstract void setDisableXmlSchemaValidation(boolean disabled)
disabled
- whether to disable or not.protected final String constructValidationUrl(String ticket, String serviceUrl)
ticket
- the ticket to be validated.serviceUrl
- the service identifier.protected final String encodeUrl(String url)
url
- the url to encode.protected abstract Assertion parseResponseFromServer(String response) throws TicketValidationException
response
- the response from the server, in any format.TicketValidationException
- if an Assertion could not be created.protected abstract String retrieveResponseFromServer(URL validationUrl, String ticket)
validationUrl
- the url to send the validation request to.ticket
- the ticket to validate.public Assertion validate(String ticket, String service) throws TicketValidationException
TicketValidator
validate
in interface TicketValidator
ticket
- the ticket to attempt to validate.service
- the service this ticket is valid for.TicketValidationException
- if the ticket cannot be validated.public final void setRenew(boolean renew)
public final void setHostnameVerifier(HostnameVerifier verifier)
public final void setEncoding(String encoding)
protected final String getEncoding()
Copyright © 2006–2013 Jasig. All rights reserved.