【问题标题】:shibboleth: resolving attributes based on multiple LDAP attributesshibboleth:基于多个 LDAP 属性解析属性
【发布时间】:2016-10-04 21:53:54
【问题描述】:

使用Shibboleth,是否可以配置attribute-resolver.xml 以根据多个LDAP 属性的存在来设置和释放一个属性?例如,我想向服务提供商发布一个“email”属性:如果 LDAP 具有“email_2”的属性和值,则使用该值……否则使用 LDAP 属性“email”中的值。

【问题讨论】:

    标签: shibboleth


    【解决方案1】:

    我使用嵌入式脚本对其进行了哈希处理 ....

    <resolver:AttributeDefinition id="setEmail" xsi:type="ad:Script" dependencyOnly="true">
    <resolver:Dependency ref="myLDAP" />
    <ad:Script><![CDATA[
                importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);
                setEmail = new BasicAttribute("setEmail");
                if(typeof alt_email != "undefined" && alt_email !=null)
                {
                      setEmail.getValues().add(alt_email.getValues().get(0));
                }
                else 
                {
                        setEmail.getValues().add(email.getValues().get(0));
                }
        ]]></ad:Script>
    

    【讨论】:

      猜你喜欢
      • 2017-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多