Skip to content

Instantly share code, notes, and snippets.

@pefoley2
Created April 9, 2015 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pefoley2/ea7aa9aa5964a998203d to your computer and use it in GitHub Desktop.
Save pefoley2/ea7aa9aa5964a998203d to your computer and use it in GitHub Desktop.
#!/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