use of net.shibboleth.idp.attribute.resolver.ResolutionException in project cas by apereo.
the class ShibbolethPersonAttributeDao method getPerson.
@Override
public IPersonAttributes getPerson(final String uid) {
final AttributeResolutionContext attributeResolutionContext = new AttributeResolutionContext();
attributeResolutionContext.setPrincipal(uid);
try {
this.attributeResolver.resolveAttributes(attributeResolutionContext);
final Map<String, List<Object>> attributes = attributeResolutionContext.getResolvedIdPAttributes().entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, p -> p.getValue().getValues().stream().map(IdPAttributeValue::getValue).collect(Collectors.toList())));
return new NamedPersonImpl(uid, attributes);
} catch (final ResolutionException e) {
throw Throwables.propagate(e);
}
}
Aggregations