/** {@inheritDoc} */ public void marshallAttributes(XMLObject samlElement, Element domElement) { Endpoint endpoint = (Endpoint) samlElement; if (endpoint.getBinding() != null) { domElement.setAttributeNS(null, Endpoint.BINDING_ATTRIB_NAME, endpoint.getBinding().toString()); } if (endpoint.getLocation() != null) { domElement.setAttributeNS(null, Endpoint.LOCATION_ATTRIB_NAME, endpoint.getLocation().toString()); } if (endpoint.getResponseLocation() != null) { domElement.setAttributeNS(null, Endpoint.RESPONSE_LOCATION_ATTRIB_NAME, endpoint.getResponseLocation() .toString()); } Attr attribute; for (Entry<QName, String> entry : endpoint.getUnknownAttributes().entrySet()) { attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey()); attribute.setValue(entry.getValue()); domElement.setAttributeNodeNS(attribute); if (Configuration.isIDAttribute(entry.getKey()) || endpoint.getUnknownAttributes().isIDAttribute(entry.getKey())) { attribute.getOwnerElement().setIdAttributeNode(attribute, true); } } } }
log.debug("Found endpoint {} for request URL {} based on location attribute in metadata", endpoint, requestURL); return endpoint; } else if (endpoint.getResponseLocation() != null && uriComparator.compare(endpoint.getResponseLocation(), requestURL)) { log.debug("Found endpoint {} for request URL {} based on response location attribute in metadata", endpoint, requestURL); return endpoint;
/** * Verifies that the destination URL intended in the message matches with the endpoint address. The URL message * was ultimately received doesn't need to necessarily match the one defined in the metadata (in case of e.g. reverse-proxying * of messages). * * @param endpoint endpoint the message was received at * @param destination URL of the endpoint the message was intended to be sent to by the peer or null when not included * @throws SAMLException in case endpoint doesn't match */ protected void verifyEndpoint(Endpoint endpoint, String destination) throws SAMLException { // Verify that destination in the response matches one of the available endpoints if (destination != null) { if (uriComparator.compare(destination, endpoint.getLocation())) { // Expected } else if (uriComparator.compare(destination, endpoint.getResponseLocation())) { // Expected } else { throw new SAMLException("Intended destination " + destination + " doesn't match any of the endpoint URLs on endpoint " + endpoint.getLocation() + " for profile " + getProfileIdentifier()); } } }
&& !DatatypeHelper.isEmpty(endpoint.getResponseLocation())) { urlBuilder = new URLBuilder(endpoint.getResponseLocation()); } else { if (DatatypeHelper.isEmpty(endpoint.getLocation())) {
&& !DatatypeHelper.isEmpty(endpoint.getResponseLocation())) { urlBuilder = new URLBuilder(endpoint.getResponseLocation()); } else { if (DatatypeHelper.isEmpty(endpoint.getLocation())) {