This project demonstrates a minimal usage of Perfect-LDAP library by connecting to a Windows 2000 Domain Controller and searching for domain users.
Linux Build Note
Please make sure the following libraries were installed on Ubuntu 16.04:
$ sudo apt-get -y install libsasl2-dev libldap2-dev
- Check out or download the project:
$ git clone https://github.com/PerfectExamples/Perfect-LDAP-Demo.git
Once download, please modify login information to fit to your server configuration in main.swift:
// equivalent to ldapsearch -D let dn = "CN=judy,CN=Users,DC=perfect,DC=com" // equivalent to -w let password = "0penLDAP" // equivalent to -H let url = "ldap://192.168.56.15" // equivalent to -b let base = "CN=Users,DC=perfect,DC=com" // equivalent to -s sub let scope: LDAP.Scope = .SUBTREE
NOTE These parameters are equivalent to:
$ ldapsearch -D "CN=judy,CN=Users,DC=perfect,DC=com" -w "0penLDAP" -H "ldap://192.168.56.15" -b "CN=Users,DC=perfect,DC=com" -s sub -x
- In terminal, navigate to the directory and execute
$ cd Perfect-LDAP-Demo $ swift build
Once done, you could try
./.build/debug/PerfectLDAPDemo to see the searching result. If nothing wrong, it should return a dictionary with all users details on the server.
We are transitioning to using JIRA for all bugs and support related issues, therefore the GitHub issues has been disabled.
If you find a mistake, bug, or any other helpful suggestion you'd like to make on the docs please head over to http://jira.perfect.org:8080/servicedesk/customer/portal/1 and raise it.
A comprehensive list of open issues can be found at http://jira.perfect.org:8080/projects/ISS/issues
For more information on the Perfect project, please visit perfect.org.