diff --git a/authentik/sources/ldap/tests/mock_ad.py b/authentik/sources/ldap/tests/mock_ad.py index b0914bda4f..9c0be2109c 100644 --- a/authentik/sources/ldap/tests/mock_ad.py +++ b/authentik/sources/ldap/tests/mock_ad.py @@ -34,7 +34,7 @@ def mock_ad_connection(password: str) -> Connection: "objectSid": "unique-test-group", "objectClass": "group", "distinguishedName": "cn=group1,ou=groups,dc=goauthentik,dc=io", - "member": ["cn=user0,ou=users,dc=goauthentik,dc=io"], + "member": ["cn=user,ou=users,dc=goauthentik,dc=io"], }, ) # Group without SID @@ -47,7 +47,7 @@ def mock_ad_connection(password: str) -> Connection: }, ) connection.strategy.add_entry( - "cn=user0,ou=users,dc=goauthentik,dc=io", + "cn=user0,ou=foo,ou=users,dc=goauthentik,dc=io", { "userPassword": password, "sAMAccountName": "user0_sn", diff --git a/authentik/sources/ldap/tests/test_auth.py b/authentik/sources/ldap/tests/test_auth.py index 48f04bf293..0e634e3a37 100644 --- a/authentik/sources/ldap/tests/test_auth.py +++ b/authentik/sources/ldap/tests/test_auth.py @@ -55,7 +55,7 @@ class LDAPSyncTests(TestCase): ) connection.assert_called_with( connection_kwargs={ - "user": "cn=user0,ou=users,dc=goauthentik,dc=io", + "user": "cn=user0,ou=foo,ou=users,dc=goauthentik,dc=io", "password": LDAP_PASSWORD, } ) diff --git a/blueprints/system/sources-ldap.yaml b/blueprints/system/sources-ldap.yaml index dbf8891e7b..66e1462eee 100644 --- a/blueprints/system/sources-ldap.yaml +++ b/blueprints/system/sources-ldap.yaml @@ -11,7 +11,6 @@ entries: name: "authentik default LDAP Mapping: DN to User Path" object_field: "path" expression: | - dn = ldap.get("distinguishedName") path_elements = [] for pair in dn.split(","): attr, _, value = pair.partition("=")