org.apache.cxf.ws.security.wss4j.SAMLUtils.parseRolesInAssertion(assertionWrapper, roleAttributeName);
final Set<Principal> userRoles;
if (roles != null) {
userRoles = new HashSet<Principal>();
for (String role : roles) {
userRoles.add(new SimplePrincipal(role));
}
} else {
userRoles = null;
}
SAMLSecurityContext context =
new SAMLSecurityContext(new SimplePrincipal(name), userRoles);
context.setIssuer(org.apache.cxf.ws.security.wss4j.SAMLUtils.getIssuer(assertionWrapper));
context.setAssertionElement(
org.apache.cxf.ws.security.wss4j.SAMLUtils.getAssertionElement(assertionWrapper));
m.put(SecurityContext.class, context);