From 892299a791290e1755ff33209a9e090a2d12c976 Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Wed, 25 Feb 2026 15:35:02 +1100 Subject: [PATCH] bug: device enrolment match initially match on account name instead of account id --- Disco.Services/Devices/Enrolment/WindowsDeviceEnrolment.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Disco.Services/Devices/Enrolment/WindowsDeviceEnrolment.cs b/Disco.Services/Devices/Enrolment/WindowsDeviceEnrolment.cs index 7cc95e9b..b8e6a0da 100644 --- a/Disco.Services/Devices/Enrolment/WindowsDeviceEnrolment.cs +++ b/Disco.Services/Devices/Enrolment/WindowsDeviceEnrolment.cs @@ -188,7 +188,7 @@ namespace Disco.Services.Devices.Enrolment { if (!authenticatedToken.Has(Claims.ComputerAccount)) throw new EnrolmentSafeException($"Connection not correctly authenticated (SN: {Request.SerialNumber}; Auth User: {authenticatedToken.User.UserId})"); - else if (!string.Equals($"{Request.ComputerName}$", authenticatedToken.User.UserId, StringComparison.OrdinalIgnoreCase)) + else if (!string.Equals($"{Request.ComputerName}$", authenticatedToken.User.DomainUsername, StringComparison.OrdinalIgnoreCase)) throw new InvalidOperationException($"Connection not correctly authenticated (SN: {Request.SerialNumber}; Computer Name: {Request.ComputerName}; Auth User: {authenticatedToken.User.UserId})"); if (domain == null && !ActiveDirectory.Context.TryGetDomainByName(Request.DNSDomainName, out domain))