use of org.opensaml.saml.common.profile.logic.EntityAttributesPredicate in project cas by apereo.
the class InCommonRSAttributeReleasePolicy method getAttributesForSamlRegisteredService.
@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) {
final EntityAttributesPredicate.Candidate attr = new EntityAttributesPredicate.Candidate("http://macedir.org/entity-category");
attr.setValues(Collections.singletonList("http://refeds.org/category/research-and-scholarship"));
LOGGER.debug("Loading entity attribute predicate filter for candidate [{}] with values [{}]", attr.getName(), attr.getValues());
final EntityAttributesPredicate predicate = new EntityAttributesPredicate(Collections.singletonList(attr), true);
if (predicate.apply(entityDescriptor)) {
return authorizeReleaseOfAllowedAttributes(attributes);
}
return new HashMap<>();
}
use of org.opensaml.saml.common.profile.logic.EntityAttributesPredicate in project cas by apereo.
the class MetadataEntityAttributesAttributeReleasePolicy method getAttributesForSamlRegisteredService.
@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) {
final EntityAttributesPredicate.Candidate attr = new EntityAttributesPredicate.Candidate(this.entityAttribute, this.entityAttributeFormat);
attr.setValues(this.entityAttributeValues);
LOGGER.debug("Loading entity attribute predicate filter for candidate [{}] with values [{}]", attr.getName(), attr.getValues());
final EntityAttributesPredicate predicate = new EntityAttributesPredicate(CollectionUtils.wrap(attr), true);
if (predicate.apply(entityDescriptor)) {
return authorizeReleaseOfAllowedAttributes(attributes);
}
return new HashMap<>(0);
}
Aggregations