use of org.apache.karaf.jaas.boot.principal.RolePrincipal in project ddf by codice.
the class SecurityAssertionSaml method getPrincipals.
@Override
public Set<Principal> getPrincipals() {
Set<Principal> principals = new HashSet<>();
Principal primary = getPrincipal();
principals.add(primary);
principals.add(new RolePrincipal(primary.getName()));
for (AttributeStatement attributeStatement : getAttributeStatements()) {
for (Attribute attr : attributeStatement.getAttributes()) {
if (StringUtils.containsIgnoreCase(attr.getName(), "role")) {
for (final String obj : attr.getValues()) {
principals.add(new RolePrincipal(obj));
}
}
}
}
return principals;
}
Aggregations