Network Deployment (Distributed operating systems), v8.0 > Secure applications and their environment > Authenticate users > Select a registry or repository > Manage realms in a federated repository


Configure custom adapters for federated repositories using wsadmin

Use scripting to define custom adapters in the federated repositories configuration file...

See also IdMgrRepositoryConfig.


Add a custom adapter to a federated repositories configuration file

  1. Edit wimconfig.xml.

  2. Add a new config:repositories element to the file.

    This element should be placed before the config:realmConfiguration element.

    The following example configures a custom repository to use the com.ibm.ws.wim.adapter.sample.SampleFileAdapter class and sets the SampleFileRepository repository as the identifier:

      <config:repositories adapterClassName="com.ibm.ws.wim.adapter.sample.SampleFileAdapter" id="SampleFileRepository"/>

  3. Save the wimconfig.xml file and close the text editor.

  4. Copy the vmmsampleadapter.jar file provided to WAS_HOME/lib.

  5. Start wsadmin.sh:

      wsadmin -conntype none

  6. Disable paging in the common repository configuration. Set the supportPaging parameter for the updateIdMgrRepository command to false to disable paging.

    We must perform this step because the sample adapter does not support paging.

    The following examples use the SampleFileRepository repository as the identifier for the custom repository.

    ### Jython

      AdminTask.updateIdMgrRepository('-id SampleFileRepository -supportPaging false')

    ### Jacl

      $AdminTask updateIdMgrRepository {-id SampleFileRepository -supportPaging false}

    A warning will appear until the configuration of the sample repository is complete.

  7. Add the necessary custom properties for the adapter.

    Use the setIdMgrCustomProperty command repeatedly to add multiple properties. Use this command once per property to add multiple properties to the configuration. We must use both the name and value parameters to add the custom property for the specified repository. For example, to add a custom property of fileName, run.

    ### Jython

      AdminTask.setIdMgrCustomProperty('-id SampleFileRepository -name fileName -value "c:\sampleFileRegistry.xml"')

    ### Jacl

      $AdminTask setIdMgrCustomProperty {-id SampleFileRepository -name fileName -value "c:\sampleFileRegistry.xml"}

  8. Add a base entry to the adapter configuration. Use the addIdMgrRepositoryBaseEntry command to specify the name of the base entry for the specified repository. For example:

    ### Jython

      AdminTask.addIdMgrRepositoryBaseEntry('-id SampleFileRepository -name o=sampleFileRepository')

    ### Jacl

      $AdminTask addIdMgrRepositoryBaseEntry {-id SampleFileRepository -name o=sampleFileRepository}

  9. Add the base entry to the realm, which will link the realm with the repository:

    ### Jython

      AdminTask.addIdMgrRealmBaseEntry('-name defaultWIMFileBasedRealm -baseEntry o=sampleFileRepository')

    ### Jacl

      $AdminTask addIdMgrRealmBaseEntry {-name defaultWIMFileBasedRealm -baseEntry o=sampleFileRepository}

  10. Save the configuration changes. Enter the following commands to save the new configuration and close wsadmin.sh.

    ### Jython

      AdminConfig.save() exit

    ### Jacl

      $AdminConfig save exit

    The following example displays the complete text of the newly-revised wimconfig.xml file:

    <!--
      Begin Copyright
    
      Licensed Materials - Property of IBM
      virtual member manager
    
      (C) Copyright IBM Corp. 2005 All Rights Reserved.
    
    
      End Copyright
    -->
    <sdo:datagraph xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:config="http://www.ibm.com/websphere/wim
    /config" xmlns:sdo="commonj.sdo">
    <config:configurationProvider maxPagingResults="500" maxSearchResults="4500"
    maxTotalPagingResults="1000"
    pagedCacheTimeOut="900" pagingEntityObject="true" searchTimeOut="600000">
    <config:dynamicModel xsdFileName="wimdatagraph.xsd"/>
    <config:supportedEntityTypes defaultParent="o=defaultWIMFileBasedRealm" name="Group">
    <config:rdnProperties>cn
    </config:rdnProperties>
    </config:supportedEntityTypes>
    <config:supportedEntityTypes defaultParent="o=defaultWIMFileBasedRealm" name="OrgContainer">
    <config:rdnProperties>o
    </config:rdnProperties>
    <config:rdnProperties>ou
    </config:rdnProperties>
    <config:rdnProperties>dc
    </config:rdnProperties>
    <config:rdnProperties>cn
    </config:rdnProperties>
    </config:supportedEntityTypes>
    <config:supportedEntityTypes defaultParent="o=defaultWIMFileBasedRealm" name="PersonAccount">
    <config:rdnProperties>uid
    </config:rdnProperties>
    </config:supportedEntityTypes>
    <config:repositories xsi:type="config:FileRepositoryType" adapterClassName="com.ibm.
        ws.wim.adapter.file.was.FileAdapter"
    id="InternalFileRepository" supportPaging="false" supportSorting="false" messageDigestAlgorithm="SHA-1">
    <config:baseEntries name="o=defaultWIMFileBasedRealm"/>
    </config:repositories>
    <config:repositories adapterClassName="com.ibm.ws.wim.adapter.sample.SampleFileAdapter"
        id="SampleFileRepository">
    <config:CustomProperties name="fileName" value="c:\sampleFileRegistry.xml"/>
    <config:baseEntries name="o=sampleFileRepository"/>
    </config:repositories>
    <config:realmConfiguration defaultRealm="defaultWIMFileBasedRealm">
    <config:realms delimiter="@" name="defaultWIMFileBasedRealm" securityUse="active">  
    <config:participatingBaseEntries name="o=defaultWIMFileBasedRealm"/>  
    <config:participatingBaseEntries name="o=sampleFileRepository"/>  
    <config:uniqueUserIdMapping propertyForInput="uniqueName" propertyForOutput="uniqueName"/>  
    <config:userSecurityNameMapping propertyForInput="principalName" propertyForOutput="principalName"/>  
    <config:userDisplayNameMapping propertyForInput="principalName" propertyForOutput="principalName"/>  
    <config:uniqueGroupIdMapping propertyForInput="uniqueName" propertyForOutput="uniqueName"/>  
    <config:groupSecurityNameMapping propertyForInput="cn" propertyForOutput="cn"/>  
    <config:groupDisplayNameMapping propertyForInput="cn" propertyForOutput="cn"/>
    </config:realms>
    </config:realmConfiguration>
    </config:configurationProvider>
    </sdo:datagraph> 

  11. Restart the application server.


twim_custom_config.html


Related


Sample custom adapters for federated repositories examples
IdMgrRepositoryConfig command group

+

Search Tips   |   Advanced Search