7 instantiations of WindowsIdentity
Microsoft.AspNetCore.Server.HttpSys (1)
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
357var identity = new WindowsIdentity(authInfo->AccessToken, GetAuthTypeFromRequest(authInfo->AuthType));
Microsoft.AspNetCore.Server.IIS (2)
Core\IISHttpContext.cs (1)
913return new WindowsPrincipal(new WindowsIdentity(token, authenticationType));
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (1)
357var identity = new WindowsIdentity(authInfo->AccessToken, GetAuthTypeFromRequest(authInfo->AuthType));
Microsoft.AspNetCore.Server.IISIntegration (1)
IISMiddleware.cs (1)
179var winIdentity = new WindowsIdentity(handle, IISDefaults.AuthenticationScheme);
System.Security.Principal.Windows (3)
System\Security\Principal\WindowsIdentity.cs (3)
370return new WindowsIdentity(); 826return new WindowsIdentity(safeTokenHandle); 975return new WindowsIdentity(this);
92 references to WindowsIdentity
aspire (2)
Certificates\CertificateGeneration\WindowsCertificateManager.cs (2)
145var currentUser = WindowsIdentity.GetCurrent();
Aspire.Hosting.RemoteHost (1)
JsonRpcServer.cs (1)
85var currentUser = WindowsIdentity.GetCurrent().User;
csc (4)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
699var currentIdentity = WindowsIdentity.GetCurrent();
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (2)
71var currentIdentity = WindowsIdentity.GetCurrent();
dotnet (6)
Commands\Test\MTP\TestApplication.cs (2)
444using WindowsIdentity identity = WindowsIdentity.GetCurrent();
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.12.0-1.26430.105\contentFiles\cs\net11.0\BuildServerConnection.cs (2)
699var currentIdentity = WindowsIdentity.GetCurrent();
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.12.0-1.26430.105\contentFiles\cs\net11.0\NamedPipeUtil.cs (2)
71var currentIdentity = WindowsIdentity.GetCurrent();
dotnet-aot (2)
src\sdk\src\Cli\dotnet\Commands\Test\MTP\TestApplication.cs (2)
444using WindowsIdentity identity = WindowsIdentity.GetCurrent();
dotnet-dev-certs (2)
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
148var currentUser = WindowsIdentity.GetCurrent();
Microsoft.AspNetCore.Authentication.Negotiate (1)
NegotiateHandler.cs (1)
325if (OperatingSystem.IsWindows() && identity is WindowsIdentity winIdentity)
Microsoft.AspNetCore.DataProtection (4)
Repositories\RegistryXmlRepository.cs (1)
94WindowsIdentity.GetCurrent()!.User!.Value);
XmlEncryption\DpapiNGXmlEncryptor.cs (2)
104using (var currentIdentity = WindowsIdentity.GetCurrent())
XmlEncryption\DpapiXmlEncryptor.cs (1)
59_logger.EncryptingToWindowsDPAPIForCurrentUserAccount(WindowsIdentity.GetCurrent().Name);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (2)
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
148var currentUser = WindowsIdentity.GetCurrent();
Microsoft.AspNetCore.Http.Connections (4)
Internal\HttpConnectionDispatcher.cs (4)
891if (transportType == HttpTransportType.LongPolling && connection.User?.Identity is WindowsIdentity) 964return user?.Identities.Any(static identity => identity is WindowsIdentity) == true; 972if (oldContext.User.Identity is WindowsIdentity windowsIdentity) 979newContext.User = new WindowsPrincipal((WindowsIdentity)(windowsIdentity.Clone()));
Microsoft.AspNetCore.Server.HttpSys (3)
RequestProcessing\Request.cs (1)
493(User?.Identity as WindowsIdentity)?.Dispose();
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
357var identity = new WindowsIdentity(authInfo->AccessToken, GetAuthTypeFromRequest(authInfo->AuthType)); 367return new WindowsPrincipal(WindowsIdentity.GetAnonymous()); // Anonymous / !IsAuthenticated
Microsoft.AspNetCore.Server.IIS (3)
Core\IISHttpContext.cs (1)
865if (WindowsUser?.Identity is WindowsIdentity wi)
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
357var identity = new WindowsIdentity(authInfo->AccessToken, GetAuthTypeFromRequest(authInfo->AuthType)); 367return new WindowsPrincipal(WindowsIdentity.GetAnonymous()); // Anonymous / !IsAuthenticated
Microsoft.AspNetCore.Server.IISIntegration (1)
IISMiddleware.cs (1)
179var winIdentity = new WindowsIdentity(handle, IISDefaults.AuthenticationScheme);
Microsoft.AspNetCore.Server.Kestrel.Core (2)
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
148var currentUser = WindowsIdentity.GetCurrent();
Microsoft.AspNetCore.SignalR.Core (1)
Hub.cs (1)
99/// (for example a <see cref="System.Security.Principal.WindowsIdentity"/>'s <c>SafeHandle</c>)
Microsoft.Build.Framework (1)
BackEnd\CommunicationsUtilities.cs (1)
676new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator))
Microsoft.Build.Tasks.CodeAnalysis (4)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
699var currentIdentity = WindowsIdentity.GetCurrent();
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (2)
71var currentIdentity = WindowsIdentity.GetCurrent();
Microsoft.CodeAnalysis.BuildClient.Package (4)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
699var currentIdentity = WindowsIdentity.GetCurrent();
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (2)
71var currentIdentity = WindowsIdentity.GetCurrent();
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (2)
71var currentIdentity = WindowsIdentity.GetCurrent();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (2)
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (2)
71var currentIdentity = WindowsIdentity.GetCurrent();
Microsoft.DotNet.Cli.Utils (1)
Windows.cs (1)
25new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
Microsoft.ML.TensorFlow (2)
TensorflowUtils.cs (2)
294WindowsIdentity currentIdentity = null; 297currentIdentity = WindowsIdentity.GetCurrent();
Microsoft.VisualBasic.Forms (2)
Microsoft\VisualBasic\ApplicationServices\WindowsFormsApplicationBase.vb (2)
160Dim ntIdentity As Principal.WindowsIdentity = Principal.WindowsIdentity.GetCurrent
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (1)
ObjectModel\TestRun.cs (1)
70_runUser = WindowsIdentity.GetCurrent().Name;
mscorlib (1)
src\runtime\src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
1059[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Principal.WindowsIdentity))]
RepoTasks (2)
src\aspnetcore\src\Shared\CertificateGeneration\WindowsCertificateManager.cs (2)
148var currentUser = WindowsIdentity.GetCurrent();
System.Diagnostics.PerformanceCounter (2)
misc\EnvironmentHelpers.cs (2)
43using (WindowsIdentity wi = WindowsIdentity.GetCurrent(TokenAccessLevels.Query))
System.DirectoryServices (2)
System\DirectoryServices\ActiveDirectory\DirectoryContext.cs (2)
601using WindowsIdentity identity = WindowsIdentity.GetCurrent();
System.DirectoryServices.AccountManagement (2)
System\DirectoryServices\AccountManagement\Utils.cs (2)
537using (WindowsIdentity currentIdentity = System.Security.Principal.WindowsIdentity.GetCurrent())
System.Security.Principal.Windows (14)
System\Security\Principal\WindowsIdentity.cs (9)
72protected WindowsIdentity(WindowsIdentity identity) 343public static WindowsIdentity GetCurrent() 350public static WindowsIdentity? GetCurrent(bool ifImpersonating) 357public static WindowsIdentity GetCurrent(TokenAccessLevels desiredAccess) 368public static WindowsIdentity GetAnonymous() 809internal static WindowsIdentity? GetCurrentInternal(TokenAccessLevels desiredAccess, bool threadOnly) 963private static string? GetAuthType(WindowsIdentity identity) 971/// Returns a new instance of <see cref="WindowsIdentity"/> with values copied from this object. 1005/// Gets the claims as <see cref="IEnumerable{Claim}"/>, associated with this <see cref="WindowsIdentity"/>.
System\Security\Principal\WindowsPrincipal.cs (5)
27private readonly WindowsIdentity _identity; 33public WindowsPrincipal(WindowsIdentity ntIdentity) 82if (identity is WindowsIdentity wi) 103if (identity is WindowsIdentity wi) 183private static WindowsPrincipal GetDefaultInstance() => new WindowsPrincipal(WindowsIdentity.GetCurrent());
System.ServiceModel.NetFramingBase (2)
System\ServiceModel\Security\SecurityUtilsEx.cs (2)
180WindowsIdentity windows = identity as WindowsIdentity;
System.ServiceModel.Primitives (2)
System\ServiceModel\Security\SecurityUtils.cs (2)
796using (WindowsIdentity self = WindowsIdentity.GetCurrent())
vbc (4)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
699var currentIdentity = WindowsIdentity.GetCurrent();
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (2)
71var currentIdentity = WindowsIdentity.GetCurrent();
VBCSCompiler (4)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
699var currentIdentity = WindowsIdentity.GetCurrent();
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (2)
71var currentIdentity = WindowsIdentity.GetCurrent();