Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import ldap3 as ldap
  2.  
  3. SERVER_NAME = ''
  4. DN = ''
  5. USERNAME = ''
  6. PASSWORD = ''
  7.  
  8. server = ldap.Server(SERVER_NAME)
  9. connection = ldap.Connection(server, user='{}\\{}'.format(DN, USERNAME), password=PASSWORD)
  10. connection.open()
  11. if connection.bind():
  12. print('Authenticated!')
  13. else:
  14. print('Not Authenticated')
  15. print(connection.result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement