ARTIFACTORY: LDAP Error: “Name cannot contain spaces or special character”

Joey Naor
2021-10-14 09:49

In Artifactory versions 7.20.x and above, a new special character limitation was implemented and affects the LDAP settings & group settings names in the UI.

As the LDAP setting name is greyed out and cannot be changed once created, users who upgraded from older Artifactory versions and had special characters in their LDAP settings names will not be able to apply any changes to the affected settings, as the UI will prompt the “Name cannot contain spaces or special character” error message under the “Settings Name” input:

User-added image

Luckily, the solution is quite simple and consists of manually removing or replacing the special characters in the Artifactory Config Descriptor. This can be done via the UI (recommended for this specific fix), REST API or bootstrapping.

When editing the Config Descriptor, you will need to locate the <ldapSetting> tag, under which the LDAP setting name is set via the <key> tag:

User-added image

In the above example, <key>my.ldap</key> contains a special character (dot) and can be changed to <key>my-ldap</key> or <key>myldap</key> to resolve the issue.

LDAP Group Settings:

If you have any LDAP group settings which include special characters in their name or are/were connected to LDAP settings with such names, you will need to implement a similar fix via the Config Descriptor by editing the values of <name> and <enabledLdap> under <ldapGroupSettings>:

User-added image

Please note that <enabledLdap> can also be edited via the UI (LDAP Settings dropdown):

User-added image