Skip to content

Commit

Permalink
Change use_lookup_dn_username default value to False
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Sep 23, 2024
1 parent 1845e0b commit 4f41477
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,16 @@ If found, these will be available as `auth_state["user_attributes"]`.

Only used with `lookup_dn=True`.

If configured True (default value), the `lookup_dn_user_dn_attribute`
value used to build the LDAP user's DN string is also used as the
authenticated user's JuptyerHub username.
If configured True, the `lookup_dn_user_dn_attribute` value used to
build the LDAP user's DN string is also used as the authenticated user's
JuptyerHub username.

If this is configured True, its important to ensure that the values of
`lookup_dn_user_dn_attribute` are unique even after the are normalized
to be lowercase, otherwise two LDAP users could end up sharing the same
JupyterHub username.

With ldapauthenticator 2, the default value was changed to False.

#### `LDAPAuthenticator.search_filter`

Expand Down
15 changes: 11 additions & 4 deletions ldapauthenticator/ldapauthenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,21 @@ def _observe_escape_userdn(self, change):
)

use_lookup_dn_username = Bool(
True,
False,
config=True,
help="""
Only used with `lookup_dn=True`.
If configured True (default value), the `lookup_dn_user_dn_attribute`
value used to build the LDAP user's DN string is also used as the
authenticated user's JuptyerHub username.
If configured True, the `lookup_dn_user_dn_attribute` value used to
build the LDAP user's DN string is also used as the authenticated user's
JuptyerHub username.
If this is configured True, its important to ensure that the values of
`lookup_dn_user_dn_attribute` are unique even after the are normalized
to be lowercase, otherwise two LDAP users could end up sharing the same
JupyterHub username.
With ldapauthenticator 2, the default value was changed to False.
""",
)

Expand Down
1 change: 0 additions & 1 deletion ldapauthenticator/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def c():
c.LDAPAuthenticator.user_attribute = "uid"
c.LDAPAuthenticator.lookup_dn_user_dn_attribute = "cn"
c.LDAPAuthenticator.attributes = ["uid", "cn", "mail", "ou"]
c.LDAPAuthenticator.use_lookup_dn_username = False

c.LDAPAuthenticator.allowed_groups = [
"cn=admin_staff,ou=people,dc=planetexpress,dc=com",
Expand Down

0 comments on commit 4f41477

Please sign in to comment.