I figured it out. I populated my UserDetails object inside the loadUserBySAML method I had to create when I implemented the SAMLUserDetailsService interface.
I also created a helper method for getting the attributes:
Code:
private String getAttributeByName(final String name, final SAMLCredential credential) {
Attribute attribute = credential.getAttributeByName(name);
String output = "";
if (attribute != null) {
List<XMLObject> attributes = attribute.getAttributeValues();
if (attributes.size() > 0) {
for (XMLObject object : attributes) {
XSString string = (XSString) object;
output += string.getValue() + ", ";
}
return output.substring(0, output.length() - 2);
}
}
return output;
}