jupyterhub / ldapauthenticator

LDAP Authenticator Plugin for Jupyter
BSD 3-Clause "New" or "Revised" License
202 stars 175 forks source link

AD Integration: No entry found for user when looking up attribute 'sAMAccountName' #195

Closed yash64 closed 3 years ago

yash64 commented 3 years ago

I am facing issue in configuring ldap authentication with AD integration and I get error while logging in. Below is my config file.

c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'

c.LDAPAuthenticator.server_address = '<ip>'
c.LDAPAuthenticator.server_port = 389
c.LDAPAuthenticator.use_ssl = False
c.LDAPAuthenticator.allowed_groups = []

#set up the template which used to bind the user from ldap directory
#c.LDAPAuthenticator.bind_dn_template = ["uid={username},ou=Admin,ou=Groups,dc=example,dc=com"]

#Active Directory Integration
c.LDAPAuthenticator.lookup_dn = True
c.LDAPAuthenticator.lookup_dn_search_filter = '({login_attr}={login})'
c.LDAPAuthenticator.lookup_dn_search_user = 'user@example.com'
c.LDAPAuthenticator.lookup_dn_search_password = 'redact'
c.LDAPAuthenticator.user_search_base = 'ou=Admin,ou=Groups,dc=example,dc=com'
c.LDAPAuthenticator.user_attribute = 'sAMAccountName'
c.LDAPAuthenticator.lookup_dn_user_dn_attribute = 'cn'
c.LDAPAuthenticator.escape_userdn = False
c.LDAPAuthenticator.bind_dn_template = '{username}'

While logging to jupyterhub with my user I get below error.

[W 2021-03-18 05:02:18.675 JupyterHub ldapauthenticator:275] No entry found for user 'testuser' when looking up attribute 'sAMAccountName'
[W 2021-03-18 05:02:18.675 JupyterHub base:713] Failed login for testuser

versions

python==3.8.5
jupyterhub==1.1.0
jupyterhub-ldapauthenticator==1.3.2

Tried different combinations in configuring the parameters but the error remains the same. c.LDAPAuthenticator.lookup_dn_search_user is the ldap account that I have mentioned. Is it the correct way? Any suggestions please.

welcome[bot] commented 3 years ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

manics commented 3 years ago

Hi :wave: This sounds like a configuration problem rather than a bug. Do you mind posting this as a support question on https://discourse.jupyter.org/ instead? Thanks!

support[bot] commented 3 years ago

Hi there @yash64 :wave:!

I closed this issue because it was labelled as a support question.

Please help us organize discussion by posting this on the http://discourse.jupyter.org/ forum.

Our goal is to sustain a positive experience for both users and developers. We use GitHub issues for specific discussions related to changing a repository's content, and let the forum be where we can more generally help and inspire each other.

Thanks you for being an active member of our community! :heart:

yash64 commented 3 years ago

Hi 👋 This sounds like a configuration problem rather than a bug. Do you mind posting this as a support question on https://discourse.jupyter.org/ instead? Thanks!

This may not be an issue to change existing content and I highly appreciate the amount of work the team does here. But as far as I have seen there is very minimal support on http://discourse.jupyter.org/ as I have seen questions related to this issue posted in the forum and there are no responses from support team. It would really be beneficial to the users if there is a dedicated team supporting on the issues. Thank you once again.

manics commented 3 years ago

@yash64 If there are no answers on the Discourse forum it's usually because we don't have an answer. This is especially the case with specialised plugins like LDAPAuthenticator which require specific domain knowledge, and are often maintained by the community. The advantage of the Discourse forum is that it's a central community forum where there's a chance someone else will be able to help. Adding another dedicated support forum unfortunately won't help with answering support questions we don't have an answer for.