public class Cas30JsonServiceTicketValidator extends Cas30ServiceTicketValidator
Cas30JsonServiceTicketValidator that attempts to parse the CAS validation response
as JSON. If the response is not formatted as JSON, it shall fallback to the XML default syntax.
The JSON response provides advantages in terms of naming and parsing CAS attributes that have special
names that otherwise may not be encoded as XML, such as the invalid <cas:special:attribute>value</cas:special:attribute>logger| Constructor and Description |
|---|
Cas30JsonServiceTicketValidator(String casServerUrlPrefix) |
| Modifier and Type | Method and Description |
|---|---|
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 Assertion |
parseResponseFromServer(String response)
Parses the response from the server into a CAS Assertion.
|
getUrlSuffixcustomParseResponse, getProxyCallbackUrl, getProxyGrantingTicketStorage, getProxyRetriever, parseAuthenticationFailureFromResponse, parsePrincipalFromResponse, parseProxyGrantingTicketFromResponse, populateUrlAttributeMap, setProxyCallbackUrl, setProxyGrantingTicketStorage, setProxyRetrieverretrieveResponseFromServerconstructValidationUrl, encodeUrl, getCasServerUrlPrefix, getCustomParameters, getEncoding, getURLConnectionFactory, isRenew, setCustomParameters, setEncoding, setRenew, setURLConnectionFactory, validatepublic Cas30JsonServiceTicketValidator(String casServerUrlPrefix)
protected Assertion parseResponseFromServer(String response) throws TicketValidationException
AbstractUrlBasedTicketValidatorparseResponseFromServer in class Cas20ServiceTicketValidatorresponse - the response from the server, in any format.TicketValidationException - if an Assertion could not be created.protected Map<String,Object> extractCustomAttributes(String xml)
Cas20ServiceTicketValidatorAttributes 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
extractCustomAttributes in class Cas20ServiceTicketValidatorxml - the XML to parse.Copyright © 2006–2018 Jasig. All rights reserved.