public class Cas20ServiceTicketValidator extends AbstractCasProtocolUrlBasedTicketValidator
logger| Constructor and Description |
|---|
Cas20ServiceTicketValidator(String casServerUrlPrefix)
Constructs an instance of the CAS 2.0 Service Ticket Validator with the supplied
CAS server url prefix.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
customParseResponse(String response,
Assertion assertion)
Template method if additional custom parsing (such as Proxying) needs to be done.
|
protected Map<String,Object> |
extractCustomAttributes(String xml)
Default attribute parsing of attributes that look like the following:
<cas:attributes>
<cas:attribute1>value</cas:attribute1>
<cas:attribute2>value</cas:attribute2>
</cas:attributes>
|
protected String |
getProxyCallbackUrl() |
protected ProxyGrantingTicketStorage |
getProxyGrantingTicketStorage() |
protected ProxyRetriever |
getProxyRetriever() |
protected String |
getUrlSuffix()
The endpoint of the validation URL.
|
protected Assertion |
parseResponseFromServer(String response)
Parses the response from the server into a CAS Assertion.
|
protected void |
populateUrlAttributeMap(Map<String,String> urlParameters)
Adds the pgtUrl to the list of parameters to pass to the CAS server.
|
void |
setProxyCallbackUrl(String proxyCallbackUrl) |
void |
setProxyGrantingTicketStorage(ProxyGrantingTicketStorage proxyGrantingTicketStorage) |
void |
setProxyRetriever(ProxyRetriever proxyRetriever) |
retrieveResponseFromServer, setDisableXmlSchemaValidationconstructValidationUrl, encodeUrl, getCasServerUrlPrefix, getCustomParameters, getEncoding, getURLConnectionFactory, isRenew, setCustomParameters, setEncoding, setRenew, setURLConnectionFactory, validatepublic Cas20ServiceTicketValidator(String casServerUrlPrefix)
casServerUrlPrefix - the CAS Server URL prefix.urlFactory - URL connection factory to use when communicating with the serverprotected final void populateUrlAttributeMap(Map<String,String> urlParameters)
populateUrlAttributeMap in class AbstractUrlBasedTicketValidatorurlParameters - the Map containing the existing parameters to send to the server.protected String getUrlSuffix()
AbstractUrlBasedTicketValidatorgetUrlSuffix in class AbstractUrlBasedTicketValidatorprotected final Assertion parseResponseFromServer(String response) throws TicketValidationException
AbstractUrlBasedTicketValidatorparseResponseFromServer in class AbstractUrlBasedTicketValidatorresponse - the response from the server, in any format.TicketValidationException - if an Assertion could not be created.protected Map<String,Object> extractCustomAttributes(String xml)
Attributes look like following also parsed correctly: <cas:attributes><cas:attribute1>value</cas:attribute1><cas:attribute2>value</cas:attribute2></cas:attributes>
This code is here merely for sample/demonstration purposes for those wishing to modify the CAS2 protocol. You'll probably want a more robust implementation or to use SAML 1.1
xml - the XML to parse.protected void customParseResponse(String response, Assertion assertion) throws TicketValidationException
response - the original response from the CAS server.assertion - the partially constructed assertion.TicketValidationException - if there is a problem constructing the Assertion.public final void setProxyCallbackUrl(String proxyCallbackUrl)
public final void setProxyGrantingTicketStorage(ProxyGrantingTicketStorage proxyGrantingTicketStorage)
public final void setProxyRetriever(ProxyRetriever proxyRetriever)
protected final String getProxyCallbackUrl()
protected final ProxyGrantingTicketStorage getProxyGrantingTicketStorage()
protected final ProxyRetriever getProxyRetriever()
Copyright © 2006-2014 Jasig. All Rights Reserved.