diff --git a/server/src/infra/ldap_handler.rs b/server/src/infra/ldap_handler.rs index c5038b2..68651a9 100644 --- a/server/src/infra/ldap_handler.rs +++ b/server/src/infra/ldap_handler.rs @@ -125,11 +125,7 @@ fn make_ldap_search_user_result_entry( base_dn_str: &str, attributes: &[String], ) -> Result { - let dn = format!( - "cn={},ou=people,{}", - user.display_name.as_str(), - base_dn_str - ); + let dn = format!("uid={},ou=people,{}", user.user_id.as_str(), base_dn_str); Ok(LdapSearchResultEntry { dn: dn.clone(), attributes: attributes @@ -165,7 +161,7 @@ fn get_group_attribute( .users .iter() .filter(|u| user_filter.map(|f| *u == f).unwrap_or(true)) - .map(|u| format!("cn={},ou=people,{}", u, base_dn_str)) + .map(|u| format!("uid={},ou=people,{}", u, base_dn_str)) .collect(), "1.1" => return Ok(None), _ => bail!("Unsupported group attribute: {}", attribute), @@ -311,7 +307,7 @@ impl LdapHandler