LDAP configuration in Nexus container from command line - Sonatype Nexus Repository - Sonatype Community
LDAP configuration in Nexus container from command line
post by rohitsajikv2 on May 9, 2021
I have a requirement to configure LDAP properties to add a new ldap connection in a Nexus container (I’m using a containerised version of Nexus, version 3.28.1) from the command line. The properties include:
- ldap host.
- port.
- protocol,
- search base dn,
- authentication method,
- Username or dn,
- User relative dn,
- object class,
- user id attribute,
- real name attribute,
- email attribute.
I have tried adding the properties in nexus-data/etc/nexus.properties file with nexus.ldap.env as the prefix, but it was not reflecting in the UI. I have also tried accessing the orientdb from the container by running nexus-orient-console.jar and connecting to the config class and adding an entry to the ldap table. That too, was not getting reflected in the db. Appreciate any help.
post by mmartz on May 10, 2021
Can you use the REST API? You can see all APIs under Admin > System > API, but this one would be /service/rest/v1/security/ldap.
post by rohitsajikv2 on May 10, 2021
Hi, thank you for the reply… I tried that, but I’m not able to authenticate the user. I searched online for an API to get an auth token or a user token, but wasn’t able to find anything that helped. A website mentioned that Nexus 3 does not have an officially supported way to achieve it (getting user token via REST API). Is there any workaround for that? If not, is it somehow possible to pass the username and password to the API?
post by mmartz on May 10, 2021
The endpoint should accept http basic auth for the username/password.