Changing LDAP datastore config from OpenAM SDK

128 views Asked by At

When changing datastore configuration using OpenAM SDK, anything works well except the password. The password resets to empty string, even if I give the related attributes "sun-idrepo-ldapv3-config-authpw". I tried many cases: removing the field from attributes, and giving a 'set' of strings. none of them made my password intact!

Here is part of my code:

fun setDataStoreConfig(realmName: String, storeName: String, newAttrs: Map<*,*>) {
  val srvConf = ServiceConfigManager(IdConstants.REPO_SERVICE, getUserSSOToken())
  val orgConf = srvConf.getOrganizationConfig(realmName, null)
  val subConf = orgConf.getSubConfig(storeName)
  val attrs =  subConf.attributes
  attrs.putAll(newAttrs)
  attrs["sun-idrepo-ldapv3-config-authpw"]=setOf("*********")
  subConf.attributes = attrs
}
1

There are 1 answers

2
Peter Major On BEST ANSWER

The ClientSDK and the OpenAM server must use the same encryption key (am.encryption.pwd property in AMConfig.properties on the ClientSDK side).

Please keep in mind that the ClientSDK is deprecated and its usage in new deployments is strongly discouraged.