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 5ba6aa1 commit 508f870
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 @@ -15,7 +15,6 @@ def authenticator():
authenticator.user_attribute = "uid"
authenticator.lookup_dn_user_dn_attribute = "cn"
authenticator.attributes = ["uid", "cn", "mail", "ou"]
authenticator.use_lookup_dn_username = False

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

0 comments on commit 508f870

Please sign in to comment.