From 4baa3e91da6258798a0c15d5aefb03ee07f9b696 Mon Sep 17 00:00:00 2001 From: "a.kotikov" Date: Fri, 17 Jul 2026 13:28:41 +0300 Subject: [PATCH] add guid parser --- Services/Ldap/ProfileLoader.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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