-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ldap login with start tls #267
base: master
Are you sure you want to change the base?
Conversation
@@ -10,16 +10,21 @@ class Authenticator: | |||
def __init__(self, config): | |||
root = os.path.abspath('./') | |||
self.ldap_url = config['auth']['ldap_url'] | |||
self.cert_path = os.path.join(root, config['auth']['ldap_cert_path']) | |||
self.start_tls = config['auth']['start_tls'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you update the sample config to add the new usage of this?
self.user_suffix = config['auth']['ldap_user_suffix'] | ||
self.authenticate = self.ldap_auth | ||
if config.get('debug'): | ||
self.authenticate = self.debug_auth | ||
|
||
def ldap_auth(self, username, password): | ||
ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, self.cert_path) | ||
if not self.start_tls: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is start tls mutually exclusive with passing a cacert file?
@@ -10,16 +10,21 @@ class Authenticator: | |||
def __init__(self, config): | |||
root = os.path.abspath('./') | |||
self.ldap_url = config['auth']['ldap_url'] | |||
self.cert_path = os.path.join(root, config['auth']['ldap_cert_path']) | |||
self.start_tls = config['auth']['start_tls'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch to config['auth'].get('start_tls') to maintain existing behavior without need for config change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^ agreed :)
I can pick this up and address the remaining issues. I agree, it should use I also would like an option to ignore server certs / name. I have a prototype code to do that. |
as title.