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()); }
@Override protected void customParseResponse(final String response, final Assertion assertion) throws TicketValidationException { final List<String> proxies = parseProxiesFromResponse(response); if (proxies == null) { throw new InvalidProxyChainTicketValidationException( "Invalid proxy chain: No proxy could be retrieved from response. " + "This indicates a problem with CAS validation. Review logs/configuration to find the root cause." ); } // this means there was nothing in the proxy chain, which is okay if (this.allowEmptyProxyChain && proxies.isEmpty()) { logger.debug("Found an empty proxy chain, permitted by client configuration"); return; } if (this.acceptAnyProxy) { logger.debug("Client configuration accepts any proxy. " + "It is generally dangerous to use a non-proxied CAS filter " + "specially for protecting resources that require proxy access."); return; } final String[] proxiedList = proxies.toArray(new String[proxies.size()]); if (this.allowedProxyChains.contains(proxiedList)) { return; } logger.warn("Proxies received from the CAS validation response are {}. " + "However, none are allowed by allowed proxy chain of the client which is {}", Arrays.toString(proxiedList), this.allowedProxyChains); throw new InvalidProxyChainTicketValidationException("Invalid proxy chain: " + proxies.toString()); }
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()); }