Created
April 9, 2015 00:00
-
-
Save pefoley2/ea7aa9aa5964a998203d to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import unicode_literals | |
import ldap3 | |
if __name__ == '__main__': | |
import ssl | |
# ssl.CERT_REQUIRED | |
tls = ldap3.Tls(validate=ssl.CERT_NONE, version=ssl.PROTOCOL_TLSv1_2) | |
server = ldap3.Server('<servername>', use_ssl=True, tls=tls) | |
connection = ldap3.Connection( | |
server, authentication=ldap3.SASL, sasl_mechanism='GSSAPI') | |
connection.bind() | |
print(connection.extend.standard.who_am_i()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment