[go: nahoru, domu]

Skip to content
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

Need help with AD authentication #65

Open
lpremani opened this issue Mar 7, 2018 · 2 comments
Open

Need help with AD authentication #65

lpremani opened this issue Mar 7, 2018 · 2 comments

Comments

@lpremani
Copy link
lpremani commented Mar 7, 2018

My LDAP server users below bind template

CN=Full name,OU=Read Only,OU=gCOR,OU=Employees,OU=Accounts,OU=Administrative Root,DC=cdaws,DC=mycompany,DC=com

What configuration variable do I need to set in "jupyterhub_config.py"

I tried with below variables and got error "Invalid username"

c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'
c.LDAPAuthenticator.server_address = 'cdaws.mycompany.com'
c.LDAPAuthenticator.bind_dn_template = 'CN={username},OU=Read Only,OU=gCOR,OU=Employees,OU=Accounts,OU=Administrative Root,DC=cdaws,DC=mycompany,DC=com'
c.LDAPAuthenticator.use_ssl = False

I can authenticate from python command prompt using below code

>>> from ldap3 import Server, Connection, ALL, NTLM
>>> server = Server('cdaws.mycompany.com', get_info=ALL)
>>> conn = Connection(server, 'CN=My Full Name,OU=Read Only,OU=gCOR,OU=Employees,OU=Accounts,OU=Administrative Root,DC=cdaws,DC=mycompany,DC=com', 'mypassword', auto_bind=True)
>>> conn.extend.standard.who_am_i()
'u:cdawsmycompany\\First.lastname'
@dhirschfeld
Copy link
Collaborator

What username are you entering in the dialog box - My Full Name? If so you might require setting c.LDAPAuthenticator.user_attribute = 'CN'

Otherwise you might also try using lookup_dn=True from the README

c.JupyterHub.authenticator_class = 'ldapauthenticator.LDAPAuthenticator'
c.LDAPAuthenticator.server_address = 'cdaws.mycompany.com'
c.LDAPAuthenticator.bind_dn_template = [
    CN={username},OU=Read Only,OU=gCOR,OU=Employees,OU=Accounts,OU=Administrative Root,DC=cdaws,DC=mycompany,DC=com'
]
c.LDAPAuthenticator.user_search_base = 'OU=Read Only,OU=gCOR,OU=Employees,OU=Accounts,OU=Administrative Root,DC=cdaws,DC=mycompany,DC=com'
c.LDAPAuthenticator.user_attribute = 'sAMAccountName'
c.LDAPAuthenticator.lookup_dn_user_dn_attribute = 'CN'
c.LDAPAuthenticator.lookup_dn = True
c.LDAPAuthenticator.lookup_dn_search_filter = '({login_attr}={login})'
c.LDAPAuthenticator.lookup_dn_search_user = "service-account-dn"
c.LDAPAuthenticator.lookup_dn_search_password = "password"
c.LDAPAuthenticator.use_ssl = False

@mannevijayakrishna
Copy link

can some one please help with the same kind of issue #115 #115 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants