Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[higgins-dev] Mapping context IDs in the idas registry

All,

I checked in a change to the idas.registry project that allows us to map card Ids to an appropriate context ID.  This was added so that the STS could support having multiple card IDs all map to the same context ID.  For example, an STS might issue cards with the following card ids:

   urn:Corporate-LDAP-Server:card1
   urn:Corporate-LDAP-Server:card2
   urn:Corporate-LDAP-Server:card3

In addition, there may be legacy cards that may have already been issued with card IDs that look as follows:

   file:///somedirectory/context.xml?id=Corporate-LDAP-Server&cardid=274Abc

Using the new mapping function, all of these different card Ids can be mapped to a single context ID (or different ones if desired).

The mapping function only maps context IDs that are passed into the fromConfiguration method of the ContextIdFactory class.  Currently, the STS passes the card id into the fromConfiguration method as the context ID.  NOTE: The fromString method on the ContextIdFactory class calls fromConfiguration under the covers, so fromString is also indirectly affected.

The mapping function is set up as follows:

1. Add the following setting handlers to your configuration file (if they are not already there):

   <SettingHandler Type="htf:jscriptexec" Class="org.eclipse.higgins.util.jscript.JScriptExec"
       Handler="org.eclipse.higgins.util.idas.cp.jscript.JScriptExecSettingHandler"/>

   <SettingHandler Type="htf:jscriptscope" Class="org.eclipse.higgins.util.jscript.JScriptScope"
        Handler="org.eclipse.higgins.util.idas.cp.jscript.JScriptScopeSettingHandler"/>

2. Add the following setting to the idas registry component settings:

   <Setting Name="JSContextIdMapper" Type="htf:jscriptexec">
      <![CDATA[
         /* Put your javascript in here.  There is one input parameter called "contextId" which is the incoming string.  The transformed
             string should be assigned to RESULT.  In the example below, we prepend "urn:" to the incoming context id.  But there are
             any number of things that could be done. */

         RESULT = "urn:" + contextId;
      ]]>
   </Setting>

Note that this is an optional setting.  If the setting is not present, context IDs will not be mapped, but will be passed through as-is.

Mike, in the STS configuration file, this setting will come under the ComponentSettings.IdentityAttributeService setting:

   <Setting Name="ComponentSettings" ...>
      ...
      <Setting Name="IdentityAttributeService" ...>
         ...
         <Setting Name="JSContextIdMapper ...>

Daniel


Back to the top