Skip to content

Commit

Permalink
docs: add get_connection docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Sep 16, 2024
1 parent d6178bc commit 537d012
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ldapauthenticator/ldapauthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ def resolve_username(self, username_supplied_by_user):
return (user_dn, response[0]["dn"])

def get_connection(self, userdn, password):
"""
Returns a ldap3 Connection object automatically bound to the user.
ldap3 Connection ref: https://ldap3.readthedocs.io/en/latest/connection.html
"""
if self.tls_strategy == TlsStrategy.on_connect:
use_ssl = True
auto_bind = ldap3.AUTO_BIND_NO_TLS
Expand Down

0 comments on commit 537d012

Please sign in to comment.