I'll Get My Coat

Identity Management? I'll Get My Coat...





« Previous month (May 2009) | Main | Next month (Jul 2009) »
Thursday Jul 09, 2009

Generating Unique ASCII AccountIds

In many situations on my travels I've been requested by customers to show how we can generate UID  attribute values that are ASCII only. Take for example the name TODORIć SNJEžANA or for example  the French name, Françoise, we want to replace the ç with an ASCCI c.  Since using extended characters for userNames can actually break many systems that expect ASCII only. For this reason I'm sharing some code that I've reused many many times during proof of concepts with Sun Identity Manager.  

First of all we're assuming you're in an ActiveSync scenario here, so we've got a <Field> element on an ActiveSync form. Let's see how we'll call this Rule to generate a unique Identity Manager accountId using ASCII characters only.

    <Field name='waveset.accountId'>
        <Expansion>
          <rule name='Custom - Generate IDM Account Id'>
            <argument name='p_firstname' value='$(activeSync.firstname)'/>
            <argument name='p_lastname' value='$(activeSync.lastname)'/>
          </rule>
        </Expansion>
      </Field>


The Rule "Custom - Generate IDM Account Id" iterates over the input strings and checks each character replacing it with a specificied ASCII alternative.

In the Rule called "Custom - Test String" there's a list of source characters that will be taken as the source list of characters to replace

    <set name='sourceList'>
     <List>
       <String>Ć</String>
       <String>Š</String>
       <String>Č</String>
       <String>Ž</String>
       <String>Đ</String>
       <String>è</String>
     </List>
   </set>

In the Rule called "Custom - Swap Char" there's the actual case statement that does the swap between the original non-ASCII char and the specified ASCII alternative.

      <case>
        <s>Š</s>
        <s>S</s>
      </case>
      <case>
        <s>Ć</s>
        <s>C</s>
      </case>
      <case>
        <s>Ž</s>
        <s>Z</s>
      </case>
      <case>
        <s>Đ</s>
        <s>DJ</s>
      </case>

Finally, the Rule "Custom - Generate IDM Account Id" ensures the generated candidate accountId is unique by querying the IdM repo and using a numeric suffix to ensure uniqueness.

You can download my original XML Rules here





Today's Page Hits: 71

analyst attachmate desktop dsee external forrester global identity identity+manager identitymanager idm irc java management opends opensso oracle rbac roles sgd srm sun vdi virtualdesktop xpress