Added CreateLocation using proper dn

This commit is contained in:
Jannis Liebig
2025-10-07 20:59:33 +02:00
parent 839cee9292
commit fc57698ee4

View File

@@ -197,7 +197,13 @@ public async Task CreateAsset(LdapAttributeSet attributeSet)
public async Task CreateLocation(LdapAttributeSet attributeSet)
{
await CreateObject(LocationsBaseDn, attributeSet);
string? cn = attributeSet.GetAttribute("cn")?.StringValue;
if (string.IsNullOrEmpty(cn))
throw new ArgumentException("AttributeSet must contain a cn attribute.");
string dn = PrependRDN($"cn={cn}", LocationsBaseDn);
await CreateObject(dn, attributeSet);
}
public async Task<UserAuthenticationResult> AuthenticateUser(string username, string password)