diff --git a/authentication/source/java/ch/systemsx/cisd/authentication/ldap/LDAPPrincipalQuery.java b/authentication/source/java/ch/systemsx/cisd/authentication/ldap/LDAPPrincipalQuery.java
index f4fea106471d49a1842747c6650d0eed3556fcd6..d710b8db76c6218a08d0fa699eb829400a69d11b 100644
--- a/authentication/source/java/ch/systemsx/cisd/authentication/ldap/LDAPPrincipalQuery.java
+++ b/authentication/source/java/ch/systemsx/cisd/authentication/ldap/LDAPPrincipalQuery.java
@@ -319,8 +319,7 @@ public final class LDAPPrincipalQuery implements ISelfTestable
                 final Attributes attributes = result.getAttributes();
                 final String userId = tryGetAttribute(attributes, config.getUserIdAttributeName());
                 final String email = tryGetAttribute(attributes, config.getEmailAttributeName());
-                final String distinguishedName =
-                        tryGetAttribute(attributes, DISTINGUISHED_NAME_ATTRIBUTE_NAME);
+                final String distinguishedName = result.getNameInNamespace();
                 if (userId != null && email != null && distinguishedName != null)
                 {
                     final String firstName =