From a02f9966c2ca37d9c215c584326cd970f066ce08 Mon Sep 17 00:00:00 2001 From: Dominion Date: Thu, 8 Jun 2023 03:37:17 -0400 Subject: [PATCH] Fixes #1527 --- .../Security/WindowsSystemIdentityFactory.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Tgstation.Server.Host/Security/WindowsSystemIdentityFactory.cs b/src/Tgstation.Server.Host/Security/WindowsSystemIdentityFactory.cs index 3646d71cd1..774170c4a4 100644 --- a/src/Tgstation.Server.Host/Security/WindowsSystemIdentityFactory.cs +++ b/src/Tgstation.Server.Host/Security/WindowsSystemIdentityFactory.cs @@ -63,11 +63,15 @@ namespace Tgstation.Server.Host.Security PrincipalContext pc = null; UserPrincipal principal = null; + GetUserAndDomainName(user.SystemIdentifier, out _, out var domainName); + bool TryGetPrincipalFromContextType(ContextType contextType) { try { - pc = new PrincipalContext(contextType); + pc = domainName != null + ? new PrincipalContext(contextType, domainName) + : new PrincipalContext(contextType); cancellationToken.ThrowIfCancellationRequested(); principal = UserPrincipal.FindByIdentity(pc, user.SystemIdentifier); }