use of org.opensaml.saml2.metadata.IndexedEndpoint in project uaa by cloudfoundry.
the class IdpInitiatedLoginController method getAssertionConsumerURL.
public String getAssertionConsumerURL(String sp) throws MetadataProviderException {
EntityDescriptor entityDescriptor = metadataManager.getEntityDescriptor(sp);
SPSSODescriptor spssoDescriptor = entityDescriptor.getSPSSODescriptor(SAMLConstants.SAML20P_NS);
List<AssertionConsumerService> assertionConsumerServices = spssoDescriptor.getAssertionConsumerServices();
Optional<AssertionConsumerService> defaultService = assertionConsumerServices.stream().filter(IndexedEndpoint::isDefault).findFirst();
if (defaultService.isPresent()) {
return defaultService.get().getLocation();
} else {
return assertionConsumerServices.get(0).getLocation();
}
}
Aggregations