org.jasig.cas.client.validation
Class Cas20ServiceTicketValidator

java.lang.Object
  extended by org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator
      extended by org.jasig.cas.client.validation.AbstractCasProtocolUrlBasedTicketValidator
          extended by org.jasig.cas.client.validation.Cas20ServiceTicketValidator
All Implemented Interfaces:
TicketValidator
Direct Known Subclasses:
Cas20ProxyTicketValidator

public class Cas20ServiceTicketValidator
extends AbstractCasProtocolUrlBasedTicketValidator

Implementation of the TicketValidator that will validate Service Tickets in compliance with the CAS 2.

Since:
3.1
Version:
$Revision$ $Date$
Author:
Scott Battaglia

Field Summary
 
Fields inherited from class org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator
hostnameVerifier, log
 
Constructor Summary
Cas20ServiceTicketValidator(String casServerUrlPrefix)
          Constructs an instance of the CAS 2.0 Service Ticket Validator with the supplied CAS server url prefix.
 
Method Summary
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 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)
           
 
Methods inherited from class org.jasig.cas.client.validation.AbstractCasProtocolUrlBasedTicketValidator
retrieveResponseFromServer, setDisableXmlSchemaValidation
 
Methods inherited from class org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator
constructValidationUrl, encodeUrl, getEncoding, setCustomParameters, setEncoding, setHostnameVerifier, setRenew, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cas20ServiceTicketValidator

public Cas20ServiceTicketValidator(String casServerUrlPrefix)
Constructs an instance of the CAS 2.0 Service Ticket Validator with the supplied CAS server url prefix.

Parameters:
casServerUrlPrefix - the CAS Server URL prefix.
Method Detail

populateUrlAttributeMap

protected final void populateUrlAttributeMap(Map<String,String> urlParameters)
Adds the pgtUrl to the list of parameters to pass to the CAS server.

Overrides:
populateUrlAttributeMap in class AbstractUrlBasedTicketValidator
Parameters:
urlParameters - the Map containing the existing parameters to send to the server.

getUrlSuffix

protected String getUrlSuffix()
Description copied from class: AbstractUrlBasedTicketValidator
The endpoint of the validation URL. Should be relative (i.e. not start with a "/"). I.e. validate or serviceValidate.

Specified by:
getUrlSuffix in class AbstractUrlBasedTicketValidator
Returns:
the endpoint of the validation URL.

parseResponseFromServer

protected final Assertion parseResponseFromServer(String response)
                                           throws TicketValidationException
Description copied from class: AbstractUrlBasedTicketValidator
Parses the response from the server into a CAS Assertion.

Specified by:
parseResponseFromServer in class AbstractUrlBasedTicketValidator
Parameters:
response - the response from the server, in any format.
Returns:
the CAS assertion if one could be parsed from the response.
Throws:
TicketValidationException - if an Assertion could not be created.

extractCustomAttributes

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>

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

Parameters:
xml - the XML to parse.
Returns:
the map of attributes.

customParseResponse

protected void customParseResponse(String response,
                                   Assertion assertion)
                            throws TicketValidationException
Template method if additional custom parsing (such as Proxying) needs to be done.

Parameters:
response - the original response from the CAS server.
assertion - the partially constructed assertion.
Throws:
TicketValidationException - if there is a problem constructing the Assertion.

setProxyCallbackUrl

public final void setProxyCallbackUrl(String proxyCallbackUrl)

setProxyGrantingTicketStorage

public final void setProxyGrantingTicketStorage(ProxyGrantingTicketStorage proxyGrantingTicketStorage)

setProxyRetriever

public final void setProxyRetriever(ProxyRetriever proxyRetriever)


Copyright © 2006-2011 Jasig. All Rights Reserved.