meatwiki 緊急メンテナンスのお知らせ

緊急システムメンテナンスのため、5/24(金) 12:00-14:00 は、本Wikiをご利用いただけません。ご不便をおかけいたしますが、ご理解の程、よろしくお願いいたします。

比較バージョン

キー

  • この行は追加されました。
  • この行は削除されました。
  • 書式設定が変更されました。

...

下記のスクリプトでは、スクリプト中で「distinguishedName」という属性の情報を取得し、文字列を比較してツリー情報を取っていま す。またtree1のアカウントは「attr1」属性、tree2のアカウントは「attr2」属性をeduPersonAffiliationの値とし て返しています。

attribute-resolver:

パネル
borderColor#cccccc
bgColor#eeeeee
borderStylesolid
<resolver:AttributeDefinition id="eduPersonAffiliation"
         xsi:type="Script" xmlns="urn:mace:shibboleth:2.0:resolver:ad"
        sourceAttributeID="eduPersonAffiliation">
 <resolver:Dependency ref="myLDAP-AD" />
<!-- snip -->
  <Script>
   <![CDATA[

importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider);

    // Create attribute to be returned from definition
    eduPersonAffiliation = new BasicAttribute("eduPersonAffiliation");

    // Get attribute
    if (typeof distinguishedName != "undefined" && distinguishedName != null) {
     for (i = 0; distinguishedName != null && i
<distinguishedName.getValues().size(); i++) {
      tree = distinguishedName.getValues().get(i);

      // tree1
      if (tree.indexOf("OU=tree1,OU=Account,DC=example,DC=ac,DC=jp") > 0) {
        if (typeof attr1!= "undefined"
                              && attr1!= null
                              && attr1.getValues().size()> 0) {
          eduPersonAffiliation.getValues().add(attr1.getValues().get(0));
         }
      }

      // tree2
      if (tree.indexOf("OU=tree2,OU=Account,DC=example,DC=ac,DC=jp") > 0) {
        if (typeof attr2!= "undefined"
                              && attr2!= null
                              && attr2.getValues().size()> 0) {
          eduPersonAffiliation.getValues().add(attr2.getValues().get(0));
        }
      }
    } //for
   } // if
 ]]>
  </Script>
</resolver:AttributeDefinition>