Spring security 从ldap+;获取spring sp中的用户属性;希伯利斯酒店
我能够将基本spring应用程序与shibboleth idp和ldap集成。 登录和注销功能工作正常。 但我在我的sp(spring应用程序)中没有找到任何与检索用户属性(如名字、姓氏、通用名等)相关的文档 请帮助我。Spring security 从ldap+;获取spring sp中的用户属性;希伯利斯酒店,spring-security,ldap,spring-ldap,shibboleth,spring-security-ldap,Spring Security,Ldap,Spring Ldap,Shibboleth,Spring Security Ldap,我能够将基本spring应用程序与shibboleth idp和ldap集成。 登录和注销功能工作正常。 但我在我的sp(spring应用程序)中没有找到任何与检索用户属性(如名字、姓氏、通用名等)相关的文档 请帮助我。Authentication-Authentication=SecurityContextHolder.getContext() Authentication authentication = SecurityContextHolder.getContext()
Authentication-Authentication=SecurityContextHolder.getContext()
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());
}
}
.getAuthentication();
SAMLCredential凭证=(SAMLCredential)身份验证
.getCredentials();
for(属性:credential.getAttributes()){
列表值=attribute.getAttributeValue();
for(XMLObject值:值){
System.out.println(value.getDOM().getTextContent());
}
}