// Load from metadata extensions
if (descriptor.getExtensions() != null) {
List<XMLObject> discoveryResponseElements = descriptor.getExtensions().getUnknownXMLObjects(DiscoveryResponse.DEFAULT_ELEMENT_NAME);
for (XMLObject element : discoveryResponseElements) {
DiscoveryResponse response = (DiscoveryResponse) element;
if (response.getBinding().equals(DiscoveryResponse.IDP_DISCO_NS)) {
logger.debug("Using IDP Discovery response URL from metadata {}", response.getLocation());
return response.getLocation();
}
}
}
// Generation for local entities at known URL