Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
XML
XML
<!-- Convert objectSid to uniqueID -->
<ScriptletAttributeDefinition id="urn:mace:switch.ch:attribute-def:swissEduPersonUniqueID">
   <DataConnectorDependency requires="directory"/>
   <Scriptlet><![CDATA[

javap(java.util.UUID// Import Apache commons codes
javap(org.apache.commons.codec.digest.DigestUtils);

// Get attributes
Attributes attributes = dependencies.getConnectorResolution("directory");
Attribute

// Get objectSid
String objectSid = attributes.get("objectSid").toString();

// Generate md5 hex of objectSid
String objectSid_enc = org.apache.commons.codec.digest.DigestUtils.md5Hex(objectSid);

// Add attribute
resolverAttribute.addValue(objectSid.toString() objectSid_enc + "@switch.ch");

      ]]>
   </Scriptlet>
</ScriptletAttributeDefinition>

...