protected String parsePrincipalFromResponse(final String response) { return XmlUtils.getTextForElement(response, "user"); }
protected List<String> parseProxiesFromResponse(final String response) { return XmlUtils.getTextForElements(response, "proxy"); }
final XMLReader reader = getXmlReader(); final StringBuilder builder = new StringBuilder();
final Document document = XmlUtils.newDocument(xml);
final XMLReader reader = getXmlReader();
protected Assertion parseResponseFromServer(final String response) throws TicketValidationException { try { final Document document = XmlUtils.newDocument(response); final Date assertionValidityStart = SamlUtils.parseUtcDate( XPATH_ASSERTION_DATE_START.evaluateAsString(document));
protected String parseProxyGrantingTicketFromResponse(final String response) { return XmlUtils.getTextForElement(response, "proxyGrantingTicket"); }
protected void customParseResponse(final String response, final Assertion assertion) throws TicketValidationException { final List proxies = XmlUtils.getTextForElements(response, "proxy"); final String[] proxiedList = (String[]) proxies.toArray(new String[proxies.size()]); // this means there was nothing in the proxy chain, which is okay if (proxies == null || proxies.isEmpty() || this.acceptAnyProxy) { return; } if (allowedProxyChains.contains(proxiedList)) { return; } throw new InvalidProxyChainTicketValidationException("Invalid proxy chain: " + proxies.toString()); }
final XMLReader reader = getXmlReader(); final StringBuffer buffer = new StringBuffer();
protected Assertion parseResponseFromServer(final String response) throws TicketValidationException { try { final Document document = XmlUtils.newDocument(response); final Date assertionValidityStart = SamlUtils.parseUtcDate( XPATH_ASSERTION_DATE_START.evaluateAsString(document));
protected String parseAuthenticationFailureFromResponse(final String response) { return XmlUtils.getTextForElement(response, "authenticationFailure"); }
protected void customParseResponse(final String response, final Assertion assertion) throws TicketValidationException { final List proxies = XmlUtils.getTextForElements(response, "proxy"); final String[] proxiedList = (String[]) proxies.toArray(new String[proxies.size()]); if (proxiedList.length>0) { assertion.getAttributes().put(GeoServerCasConstants.CAS_PROXYLIST_KEY, proxiedList); LOGGER.info("Proxy ticket validated"); } else { LOGGER.info("Service ticket validated"); } // this means there was nothing in the proxy chain, which is okay if (proxies == null || proxies.isEmpty() || this.acceptAnyProxy) { return; } if (allowedProxyChains.contains(proxiedList)) { return; } throw new InvalidProxyChainTicketValidationException("Invalid proxy chain: " + proxies.toString()); }
final String element) { final List elements = new ArrayList(2); final XMLReader reader = getXmlReader();
protected final String retrievePasswordFromResponse(final String proxyTicket) { final String url = this.clearPassUrl + (this.clearPassUrl.contains("?") ? "&" : "?") + "ticket=" + proxyTicket; final String response = retrieveResponseFromServer(url, "UTF-8"); final String password = XmlUtils.getTextForElement(response, "credentials"); if (log.isTraceEnabled()) { log.trace(String.format("ClearPass Response was:\n %s", response)); } if (CommonUtils.isNotBlank(password)) { return password; } log.error("Unable to Retrieve Password. If you see a [403] HTTP response code returned from the CommonUtils then it most likely means the proxy configuration on the CAS server is not correct.\n\n" + "Full Response from ClearPass was [" + response + "]."); return null; }
public String getProxyTicketIdFor(final String proxyGrantingTicketId, final String targetService) { final String url = constructUrl(proxyGrantingTicketId, targetService); final String response = CommonUtils.getResponseFromServer(url, this.encoding); final String error = XmlUtils.getTextForElement(response, "proxyFailure"); if (CommonUtils.isNotEmpty(error)) { log.debug(error); return null; } return XmlUtils.getTextForElement(response, "proxyTicket"); }
attributes.put(name, XmlUtils.getTextForElement(xml, name));
/** * Destroys the current HTTP session for the given CAS logout request. * * @param request HTTP request containing a CAS logout message. */ public void destroySession(final HttpServletRequest request) { final String logoutMessage = CommonUtils.safeGetParameter(request, this.logoutParameterName); if (log.isTraceEnabled()) { log.trace ("Logout request:\n" + logoutMessage); } final String token = XmlUtils.getTextForElement(logoutMessage, "SessionIndex"); if (CommonUtils.isNotBlank(token)) { final HttpSession session = this.sessionMappingStorage.removeSessionByMappingId(token); if (session != null) { String sessionID = session.getId(); if (log.isDebugEnabled()) { log.debug ("Invalidating session [" + sessionID + "] for token [" + token + "]"); } try { session.invalidate(); } catch (final IllegalStateException e) { log.debug("Error invalidating session.", e); } } } } }
String error = XmlUtils.getTextForElement(response, "authenticationFailure"); String user = XmlUtils.getTextForElement(response, "user"); String pgt = XmlUtils.getTextForElement(response, "proxyGrantingTicket"); String proxies = XmlUtils.getTextForElement(response, "proxies");
String error = XmlUtils.getTextForElement(response, "authenticationFailure"); String user = XmlUtils.getTextForElement(response, "user"); String pgt = XmlUtils.getTextForElement(response, "proxyGrantingTicket"); String proxies = XmlUtils.getTextForElement(response, "proxies");
+ proxyTicket; final String response = retrieveResponseFromServer(url, "UTF-8"); final String password = XmlUtils.getTextForElement(response, "credentials");