LDAP configuration in Nexus container from command line

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.
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.

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.

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

The endpoint should accept http basic auth for the username/password.