-
Notifications
You must be signed in to change notification settings - Fork 177
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
Debugging connection issues #116
Comments
How does the above code map to the config? The following works with my server: import ldap3
server = ldap3.Server("my-ldap.ad.server.com", port=389, use_ssl=False)
conn = ldap3.Connection(server, user="my_ldap@ad.server.com", password="super_secret", auto_bind=ldap3.AUTO_BIND_NO_TLS)
is_bound=conn.bind()
conn.search(search_base="DC=ad,DC=server,DC=com", search_scope=ldap3.SUBTREE,search_filter='(sAMAccountName=bbloggs)',attributes=ldap3.ALL_ATTRIBUTES)
resp = conn.response[0]
print(resp['attributes']['cn'])
Blogs, Bill
print(resp['attributes']['uid'])
bblogs My jupyterhub config is as follows: auth:
type: ldap
ldap:
server:
address: my-ldap.ad.server.com:389
dn:
lookup: true
search:
filter: '({login_attr}={login})'
user: 'my_ldap@ad.server.com'
password: 'super_secret'
user:
searchBase: 'DC=ad,DC=server,DC=com'
escape: False
attribute: 'sAMAccountName'
dnAttribute: 'cn' I still get the following error: |
can you please go thru the documentation and try it works for me. |
Found it. It's all down to the templates - you need to get samples of several users from your target ldap and look at their dn entries. Debugging this is quite hard, this code has no tests and a bare-bones main example. |
It can be useful to use the underlying
ldap3
library to ensure the configuration is correct. This can be done as shown below:The text was updated successfully, but these errors were encountered: