From 875c59758bf2bb44e08996e2dfa54ab605107384 Mon Sep 17 00:00:00 2001 From: Matthew Strasiotto <39424834+matthewstrasiotto@users.noreply.github.com> Date: Sat, 7 May 2022 14:48:25 +1000 Subject: [PATCH] handle dn attribute being queried as distinguishedname --- server/src/infra/ldap_handler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/infra/ldap_handler.rs b/server/src/infra/ldap_handler.rs index 31c65a7..ece9e23 100644 --- a/server/src/infra/ldap_handler.rs +++ b/server/src/infra/ldap_handler.rs @@ -108,7 +108,7 @@ fn get_user_attribute(user: &User, attribute: &str, dn: &str) -> Result vec![dn.to_string()], + "dn" | "distinguishedname" => vec![dn.to_string()], "uid" => vec![user.user_id.to_string()], "mail" => vec![user.email.clone()], "givenname" => vec![user.first_name.clone()], @@ -152,7 +152,7 @@ fn get_group_attribute( ) -> Result>> { Ok(Some(match attribute.to_lowercase().as_str() { "objectclass" => vec!["groupOfUniqueNames".to_string()], - "dn" => vec![format!( + "dn" | "distinguishedname" => vec![format!( "cn={},ou=groups,{}", group.display_name, base_dn_str )],