Swiftpack.co - Package - PerfectExamples/Perfect-LDAP-Demo

Perfect-LDAP-Demo 简体中文

Get Involed with Perfect!

Star Perfect On Github Stack Overflow Follow Perfect on Twitter Join the Perfect Slack

Swift 3.0 Platforms OS X | Linux License Apache PerfectlySoft Twitter Slack Status

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

Quick Start

  • Check out or download the project:
$ git clone https://github.com/PerfectExamples/Perfect-LDAP-Demo.git

Configure Login

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

Build

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

Issues

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

Further Information

For more information on the Perfect project, please visit perfect.org.

Github

link
Stars: 4
Help us keep the lights on

Used By

Total: 0

Releases

1.0.0 - Feb 1, 2017