Page 1 of 1

API & LDAP Users

Posted: Wed Feb 13, 2019 12:50 pm
by bomahony
Hey folks

I will need to add/remove users on a regular basis. However this is a PITA on 6 isolated environments, each hooked into their own LDAP server [rhel IDM]. The current process is to import the users each time from the "Add users from LDAP/AD" button. I put in my username as the dn string for myself, my password and it pops up the ldap tree.
I thought I would try via the API, and this option doesnt work in the API calls as there is no import. Thats fair enough.

So I thought i would use the documentation and try it, however this is what I get: [The auth-id i got from the authserver XGET referenced from the docs]
curl -k -XPOST "https://X.X.X.X/nagiosxi/api/v1/system/ ... y&pretty=1" -d 'auth_type=ldap&auth_server_id=5bacb57bc9d00&&ad_username=eddy&ldap_dn="cn=users,cn=accounts,dc=ref,dc=company,dc=net"&username=eddy&name=Electric Eddy&email=ed'
{
"success": "User account eddy was added successfully!",
"user_id": null
}

Re: API & LDAP Users

Posted: Wed Feb 13, 2019 12:55 pm
by bomahony
Turns out the issue was the missing @ in the email address [i didnt have to fill in name & email previously when doing it via GUI]

However cant seem to get the "User's Full DN:" in, as it appears blank every time.

Re: API & LDAP Users

Posted: Wed Feb 13, 2019 12:57 pm
by bomahony
Never mind, it was the " i had in there......

Re: API & LDAP Users

Posted: Wed Feb 13, 2019 1:21 pm
by scottwilkerson
bomahony wrote:Never mind, it was the " i had in there......
Ok great, glad it is resolved.

Locking thread