search cancel

Can we Update the LDAP credentials outside of the GUI?

book

Article ID: 190331

calendar_today

Updated On:

Products

CA Release Automation - Release Operations Center (Nolio) CA Release Automation - DataManagement Server (Nolio)

Issue/Introduction


We have a need to update the LDAP connection Users Password occasionally for security reasons.    Is there a way to change password configuration for LDAP account connections in CA Release Automation through a configuration file on the server or otherwise outside of updating directly in the GUI?  

 

Environment

Release : 6.6

Component : CA RELEASE AUTOMATION RELEASE OPERATIONS CENTER

Resolution


1. Find the LDAP server "id" (to be used in the second call) with:

curl -X GET --header "Accept: /" -u superuser:suser "http://yourserver.net:8080/datamanagement/ra/administration/v5/directory-servers"

This will return something like the following.  We need the ID value as shown at the bottom: 
{
  "list": [
    {
      "directoryServerConnection": {
        "adminUserName": "[email protected]",
        "isSSL": false,
        "directoryServerType": "ACTIVE_DIRECTORY",
        "adminPassword": "F89AE8809815F0AD08D7116CA9BE123E",
        "serverName": "myadservername",
        "domainName": "stegr04.te.com",
        "serverPort": 389
      },
      "directoryServerAuth": {
        "groupFilter": "(|(member={0})(uniquemember={0}))",
        "userSearchBase": "ou=people,ou=system",
        "userFilter": "uid={0}",
        "groupSearchBase": "ou=groups,ou=system"
      },
      "directoryServerImportDetails": {
        "userSearchPattern": "cn={0}*",
        "groupSearchPattern": "cn={0}*"
      },
      "serverAttributeMapping": {
        "email": "mail",
        "firstName": "givenName",
        "lastName": "sn",
        "uniqueUserName": "userPrincipalName"
      },
      "name": "stegr04.te.com",
      "id": "1"
    }
  ]
}



2. Use the ID for the directory server, in this case, "1" and place the ID after /datamanagement/a/administration/v5/directory-servers/ as shown in the following PATCH REST api call example:

curl -s -X PATCH 'http://yourserver:8080/datamanagement/a/administration/v5/directory-servers/1' --header "Accept: application/json" -u superuser:suser --data-binary '{"directoryServerConnection":{"adminPassword":"MYNEWPASSWD","isSSL":false},"directoryServerAuth":{},"directoryServerImportDetails":{},"serverAttributeMapping":{}}' --compressed --insecure -H 'Content-Type: application/json;charset=UTF-8'

the data-binary piece, prettified, is this:

{
  "directoryServerConnection":{
    "adminPassword":"myldappasswd",
    "isSSL":false
  },
  "directoryServerAuth":{},
  "directoryServerImportDetails":{},
  "serverAttributeMapping":{}
}