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 the user registry bridge for federated repositories using wsadmin.sh

The user registry bridge is configured like other custom adapters. Use the Jython or Jacl scripting language with wsadmin.sh to define the user registry bridge in the federated repositories configuration.

Shut down WAS and the wsadmin command window.

If you are migrating from the stand-alone user registry on the local operating system to federated repositories on the local operating system, first configure the current user registry under federated repositories.

Authorization failures might occur if users or groups are mapped to roles before migration and you use those users or groups after migrating to user registry bridge. This situation occurs because the mapping contains registry-specific information. After migration, re-map the users or groups to avoid authorization failures.

For additional information about the commands to use for this topic, see IdMgrRepositoryConfig command group .

Use the following steps to add a user registry bridge to any federated repositories configuration and to any realm that is defined within the configuration.


Procedure

  1. Start wsadmin.sh:
    wsadmin –conntype none 

  2. Add a new repository configuration for the user registry bridge.

    The following example configures a custom repository to use the com.ibm.ws.wim.adapter.urbridge.URBridge class and sets urbcustom as the identifier:

    Use Jython:

    AdminTask.createIdMgrCustomRepository('-id urbcustom -adapterClassName com.ibm.ws.wim.adapter.urbridge.URBridge')
    

    Use Jacl:

    $AdminTask createIdMgrCustomRepository {-id urbcustom -adapterClassName com.ibm.ws.wim.adapter.urbridge.URBridge}
    
    The user registry bridge handles requests to one user registry only. Therefore, if you define multiple repositories, each user registry implementation must have a separate instance of the user registry bridge and you must define each implementation as a separate repository with a unique repository ID..

  3. Optional: Add the necessary registry-specific properties as custom properties.

    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 uniqueUserIdProperty, run:

    Use Jython:

    AdminTask.setIdMgrCustomProperty('-id urbcustom -name uniqueUserIdProperty -value "uniqueId"')
    

    Use Jacl:

    $AdminTask setIdMgrCustomProperty {-id urbcustom -name uniqueUserIdProperty -value "uniqueId"}
    

    To configure the user registry bridge to use a custom user registry, add the registryImplClass property and specify the exact registry implementation class. For example, specify com.xyz.abc.MyCustomRegistry as the value for the property.

    To configure the user registry bridge to use the local operating system user registry, do not specify the registryImplClass property. The user registry bridge identifies the underlying user registry implementation provided by WAS for the local operating system.

    We can set other optional properties as custom properties to define the mapping between federated repository properties and user registry properties, such as uniqueUserIdProperty, userSecurityNameProperty, userDisplayNameProperty, uniqueGroupIdProperty, groupSecurityNameProperty, and groupDisplayNameProperty. For more information about the available custom properties and their default values, see Security custom properties. To override any of these properties at the user registry level, configure the property as a custom property.

  4. Add a base entry to the user registry bridge configuration. Use the addIdMgrRepositoryBaseEntry command to specify the name of the base entry for the specified repository. For example:

    Use Jython:

    AdminTask.addIdMgrRepositoryBaseEntry('-id urbcustom -name o=custom')
    

    Use Jacl:

    $AdminTask addIdMgrRepositoryBaseEntry {-id urbcustom -name o=custom}
    

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

    The default realm name is defaultWIMFileBasedRealm. If this realm name was previously renamed, use the new realm name instead of defaultWIMFileBasedRealm. For example, to ensure consistency, you can set the realm name of the federated repository to be the same name as the local operating system user registry as specified in the security.xml file.

    Use the following command:

    Use Jython:

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

    Use Jacl:

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

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

    Use Jython:

    AdminConfig.save()
    exit
    

    Use Jacl:

    $AdminConfig save exit
    

  7. Restart the application server.


Results

The following code is an example of a basic configuration in the wimconfig.xml file for a user registry bridge accessing a custom user registry:

<config:repositories adapterClassName="com.ibm.ws.wim.adapter.urbridge.URBridge" id="urbcustom">
<config:baseEntries name="o=custom"/>
<config:CustomProperties name="registryImplClass" value="com.ibm.registry.impl.FileRegistrySample"/>
<config:CustomProperties name="usersFile" value="${USER_PROPS}"/>
<config:CustomProperties name="groupsFile" value="${GROUP_PROPS}"/>
</config:repositories>

In the previous example, the ${USER_PROPS} and ${GROUP_PROPS} variables are used to define the values of the custom properties.

We can use variables to define custom properties. However, these variables are resolved only in the WAS connected mode. For information about how to define environment variables, see Creating, editing, and deleting WebSphere variables.
Manage realms in a federated repository
Create, edit, and delete WebSphere variables


Related


IdMgrRepositoryConfig command group
Security custom properties
Realm configuration settings

+

Search Tips   |   Advanced Search