Search in sources :

Example 1 with IndexedEndpoint

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();
    }
}
Also used : EntityDescriptor(org.opensaml.saml2.metadata.EntityDescriptor) SPSSODescriptor(org.opensaml.saml2.metadata.SPSSODescriptor) AssertionConsumerService(org.opensaml.saml2.metadata.AssertionConsumerService)

Aggregations

AssertionConsumerService (org.opensaml.saml2.metadata.AssertionConsumerService)1 EntityDescriptor (org.opensaml.saml2.metadata.EntityDescriptor)1 SPSSODescriptor (org.opensaml.saml2.metadata.SPSSODescriptor)1