diff --git a/Services/Ldap/ProfileLoader.cs b/Services/Ldap/ProfileLoader.cs index cf9a504..a1c5fa0 100644 --- a/Services/Ldap/ProfileLoader.cs +++ b/Services/Ldap/ProfileLoader.cs @@ -37,8 +37,17 @@ public LdapProfile LoadProfile(Configuration config, LdapConnection connection, foreach (var attr in queryAttributes.Where(x => !x.Equals("memberof", StringComparison.OrdinalIgnoreCase))) { - var value = result.Entry.Attributes[attr]?.GetValues(typeof(string)).Cast().ToArray() ?? Array.Empty(); - profileAttributes.Add(attr, value); + var dAttr = result.Entry.Attributes[attr]; + if (string.Equals(attr, "objectGUID", StringComparison.OrdinalIgnoreCase)) + { + var value = dAttr.GetValues(typeof(byte[])); + profileAttributes.Add(attr, value.Select(v => new Guid((byte[])v).ToString()).ToList()); + } + else + { + var value = dAttr?.GetValues(typeof(string)).Cast().ToArray() ?? Array.Empty(); + profileAttributes.Add(attr, value); + } } //groups