1

我能够将基本的 spring 应用程序https://github.com/UniconLabs/shibboleth-sample-java-sp与 shibboleth idp 和 ldap 集成。登录和注销功能运行良好。但我没有在我的 sp(spring app) 中找到任何与检索用户属性(如名字、姓氏、常用名等)相关的文档

请帮帮我。

4

1 回答 1

1
        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());

            }
        }
于 2016-05-03T15:11:09.070 回答