Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ldap3 as ldap
- SERVER_NAME = ''
- DN = ''
- USERNAME = ''
- PASSWORD = ''
- server = ldap.Server(SERVER_NAME)
- connection = ldap.Connection(server, user='{}\\{}'.format(DN, USERNAME), password=PASSWORD)
- connection.open()
- if connection.bind():
- print('Authenticated!')
- else:
- print('Not Authenticated')
- print(connection.result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement