How to configure LDAP using REST clients

To configure LDAP using command line (e.g. REST API), please use one of the following methods:

Method 1 : Use User-plugins

For more information on User Plugins, visit our documentation page.

Method 2 : Modify general configuration 

You may use our general configuration to modify the LDAP entries. Here are the REST APIs that you may use. 

Once the configuration is imported using General Configuration API, you will find “ldapSettings” section. We have attached a sample config (which is PART of the output of running the API) for your information. In the example below, there are two LDAP servers configured and two LDAP groups configured.

<ldapSettings>

            <ldapSetting>

                <key>sup-docker</key>

                <enabled>true</enabled>

                <ldapUrl>ldap://abc:389/dc=sup-docker</ldapUrl>

                <search>

                    <searchFilter>uid={0}</searchFilter>

                    <searchBase></searchBase>

                    <searchSubTree>true</searchSubTree>

                    <managerDn>cn=admin,dc=sup-docker</managerDn>

                    <managerPassword>aaa</managerPassword>

                </search>

                <autoCreateUser>true</autoCreateUser>

                <emailAttribute>mail</emailAttribute>

            </ldapSetting>

            <ldapSetting>

                <key>joshua-AD</key>

                <enabled>true</enabled>

                <ldapUrl>ldap://abc:389/dc=win2012joshua,dc=com</ldapUrl>

                <search>

                    <searchFilter>sAMAccountName={0}</searchFilter>

                    <searchSubTree>true</searchSubTree>

                    <managerDn>CN=Administrator,CN=Users,DC=win2012joshua,DC=com</managerDn>

                    <managerPassword>aaa</managerPassword>

                </search>

                <autoCreateUser>true</autoCreateUser>

                <emailAttribute>mail</emailAttribute>

            </ldapSetting>

        </ldapSettings>

        <ldapGroupSettings>

            <ldapGroupSetting>

                <name>sup-docker-static</name>

                <groupBaseDn>ou=Groups, dc=Support</groupBaseDn>

                <groupNameAttribute>cn</groupNameAttribute>

                <groupMemberAttribute>uniqueMember</groupMemberAttribute>

                <subTree>true</subTree>

                <filter>(objectClass=groupOfUniqueNames)</filter>

                <descriptionAttribute>description</descriptionAttribute>

                <strategy>STATIC</strategy>

                <enabledLdap>sup-docker</enabledLdap>

            </ldapGroupSetting>

            <ldapGroupSetting>

                <name>joshua-AD-dynamic</name>

                <groupBaseDn></groupBaseDn>

                <groupNameAttribute>cn</groupNameAttribute>

                <groupMemberAttribute>memberOf</groupMemberAttribute>

                <subTree>true</subTree>

                <filter>(objectClass=group)</filter>

                <descriptionAttribute>description</descriptionAttribute>

                <strategy>DYNAMIC</strategy>

                <enabledLdap>joshua-AD</enabledLdap>

            </ldapGroupSetting>

        </ldapGroupSettings>