Created
April 4, 2017 20:58
-
-
Save timoteoramos/d6cdbcedc6d7014d4e9d55bafca82f03 to your computer and use it in GitHub Desktop.
LDAP3 Simple authentication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ldap3 import Connection, Server | |
import getpass | |
SERVER = '127.0.0.1' | |
SEARCH = 'cn=%s,cn=Users,dc=example,dc=com' % input('Username: ') | |
PASSWD = getpass.getpass() | |
with Connection(Server(SERVER, use_ssl=True), SEARCH, PASSWD, auto_bind=True) as conn: | |
print(conn) | |
conn.unbind() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment