Express (Distributed operating systems), v8.0 > Secure applications and their environment > Authenticate users > Select a registry or repository > Manage realms in a federated repository > Virtual member manager > Develop with virtual member manager > Integrate virtual member manager into the application > Program tasks


Dynamically adding a new profile repository

Use this procedure to dynamically add a new profile repository to the current configuration at runtime.


About this task

When this dynamic call is made, only the configuration in memory is updated. The configuration file is not updated. We can only dynamically add an LDAP repository or a custom repository.

Event Type

DYNA_CONFIG_EVENT_ADD_REPOSITORY

Configuration Data

DYNA_CONFIG_KEY_REPOS_CONFIG (required) - [DataObject]

Profile repository configuration data object based on the wimconfig.xsd file.
The following is a sample task:


Procedure

  1. Ensure that the LDAP server is set up correctly and running. Also ensure that the base entries that you are using for the LDAP repository are created.
  2. Ensure that virtual member manager is running.

  3. Add the new LDAP repository. For example using the default virtual member manager LDAP adapter:
    DataObject configProvider = SDOHelper.createConfigProviderDataObject();
    DataObject reposDO = SDOHelper.createConfigRepositoryDataObject(configProvider,
       CONFIG_DO_LDAP_REPOSITORY_TYPE);
     reposDO.setString(CONFIG_PROP_ID, "NewLDAP");
     reposDO.setString(CONFIG_PROP_LDAP_SERVER_TYPE, "IDS60");
     reposDO.setBoolean(CONFIG_PROP_SUPPORT_PAGING, false);
     reposDO.setBoolean(CONFIG_PROP_SUPPORT_SORTING, false);
    
     DataObject baseEntry1 = SDOHelper.createConfigDataObject(reposDO,
       WIM_CONFIG_NS_URI, CONFIG_DO_BASE_ENTRIES);
     baseEntry1.set(CONFIG_PROP_NAME, "cn=realmusers,dc=yourco,dc=com");
     DataObject baseEntry2 = SDOHelper.createConfigDataObject(reposDO,
       WIM_CONFIG_NS_URI, CONFIG_DO_BASE_ENTRIES);
     baseEntry2.set(CONFIG_PROP_NAME, "cn=realmgroups,dc=yourco,dc=com");
    
     // ldap server config
     DataObject ldapServerCfgDO = SDOHelper.createConfigDataObject(reposDO,
       WIM_CONFIG_NS_URI, CONFIG_DO_LDAP_SERVER_CONFIGURATION);
     DataObject ldapServerDO = SDOHelper.createConfigDataObject(ldapServerCfgDO,
       WIM_CONFIG_NS_URI, CONFIG_DO_LDAP_SERVERS);
     ldapServerDO.setString(CONFIG_PROP_BIND_DN, "cn=yourco");
     ldapServerDO.setString(CONFIG_PROP_BIND_PASSWORD, "yourpassword");
     ldapServerDO.setBoolean(CONFIG_PROP_SSL_ENABLED, false);
     DataObject ldapConnectionDO = SDOHelper.createConfigDataObject(ldapServerDO,
       WIM_CONFIG_NS_URI, CONFIG_DO_CONNECTIONS);
     ldapConnectionDO.setString(CONFIG_PROP_HOST, "yourldap.server.yourco.com");
     ldapConnectionDO.setString(CONFIG_PROP_PORT, "389");
     Hashtable configData = new Hashtable();
     configData.put(DYNA_CONFIG_KEY_REPOS_CONFIG, reposDO);
    
     service.dynamicUpdateConfig(DYNA_CONFIG_EVENT_ADD_REPOSITORY, configData);
    

Parent topic: Program tasks



+

Search Tips   |   Advanced Search