Reputation: 309
I am able to integrate basic spring app https://github.com/UniconLabs/shibboleth-sample-java-sp with shibboleth idp and ldap. Login and logout functionalities are working fine. But I didn't find any documentation related to retrieving user attributes like first name, last name, common name etc in my sp(spring app)
Please help me out.
Upvotes: 1
Views: 484
Reputation: 309
Authentication authentication = SecurityContextHolder.getContext()
.getAuthentication();
SAMLCredential credential = (SAMLCredential) authentication
.getCredentials();
for(Attribute attribute: credential.getAttributes()){
List<XMLObject> values= attribute.getAttributeValues();
for(XMLObject value: values){
System.out.println(value.getDOM().getTextContent());
}
}
Upvotes: 1