/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { SPSSODescriptor descriptor = (SPSSODescriptor) parentSAMLObject; if (childSAMLObject instanceof AssertionConsumerService) { descriptor.getAssertionConsumerServices().add((AssertionConsumerService) childSAMLObject); } else if (childSAMLObject instanceof AttributeConsumingService) { descriptor.getAttributeConsumingServices().add((AttributeConsumingService) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }
return ((SPSSODescriptor) roleDescriptor).getAttributeConsumingServices(); } else if (roleDescriptor instanceof AttributeQueryDescriptorType) { log.debug("Resolving AttributeConsumingService candidates from AttributeQueryDescriptorType");
protected List<Attribute> getRequestAttributes(SPSSODescriptor desc) { List<Attribute> result = new LinkedList<>(); if (desc.getDefaultAttributeConsumingService() != null) { result.addAll(getRequestedAttributes(desc.getDefaultAttributeConsumingService() .getRequestAttributes())); } else { for (AttributeConsumingService s : ofNullable(desc.getAttributeConsumingServices()).orElse(emptyList())) { if (s != null) { //take the first one result.addAll(getRequestedAttributes(s.getRequestAttributes())); break; } } } return result; }
@Override protected Map<String, Object> getAttributesForSamlRegisteredService(final Map<String, Object> attributes, final SamlRegisteredService service, final ApplicationContext applicationContext, final SamlRegisteredServiceCachingMetadataResolver resolver, final SamlRegisteredServiceServiceProviderMetadataFacade facade, final EntityDescriptor entityDescriptor) { val releaseAttributes = new HashMap<String, Object>(); val sso = facade.getSsoDescriptor(); if (sso != null) { sso.getAttributeConsumingServices().forEach(svc -> svc.getRequestAttributes().stream().filter(attr -> { val name = this.useFriendlyName ? attr.getFriendlyName() : attr.getName(); LOGGER.debug("Checking for requested attribute [{}] in metadata for [{}]", name, service.getName()); return attributes.containsKey(name); }).forEach(attr -> { val name = this.useFriendlyName ? attr.getFriendlyName() : attr.getName(); LOGGER.debug("Found requested attribute [{}] in metadata for [{}]", name, service.getName()); releaseAttributes.put(name, attributes.get(name)); })); } return releaseAttributes; } }
if (null != index) { log.debug("{} Request specified AttributeConsumingService index {}", getLogPrefix(), index); for (final AttributeConsumingService acsEntry : ssoDescriptor.getAttributeConsumingServices()) { if (index.intValue() == acsEntry.getIndex()) { acs = acsEntry;
.getAttributeConsumingServices() .add(getAttributeConsumingService(sp.getRequestedAttributes()));
spDescriptor.getAttributeConsumingServices().add(attributeService);