9 instantiations of WindowsIdentity
aspire-tray (1)
WindowsTrayLauncher.cs (1)
220using (var shellIdentity = new WindowsIdentity(token.DangerousGetHandle()))
Aspire.Tray.Tests (1)
src\Aspire.Tray\Windows\WindowsTrayLauncher.cs (1)
220using (var shellIdentity = new WindowsIdentity(token.DangerousGetHandle()))
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)
189var winIdentity = new WindowsIdentity(handle, IISDefaults.AuthenticationScheme);
System.Security.Principal.Windows (3)
System\Security\Principal\WindowsIdentity.cs (3)
373return new WindowsIdentity(); 829return new WindowsIdentity(safeTokenHandle); 978return new WindowsIdentity(this);
138 references to WindowsIdentity
aspire (6)
Certificates\CertificateGeneration\WindowsCertificateManager.cs (2)
145var currentUser = WindowsIdentity.GetCurrent();
src\Shared\SocketPermissionHelper.cs (2)
136using var identity = WindowsIdentity.GetCurrent();
Utils\ConfigurationHelper.cs (2)
448using var identity = WindowsIdentity.GetCurrent();
aspire-tray (5)
SingleInstance.cs (2)
66using var identity = WindowsIdentity.GetCurrent();
WindowsTrayLauncher.cs (3)
220using (var shellIdentity = new WindowsIdentity(token.DangerousGetHandle())) 221using (var currentIdentity = WindowsIdentity.GetCurrent())
Aspire.Cli.Tests (8)
Agents\AgentConfigurationTests.cs (2)
362using var identity = WindowsIdentity.GetCurrent();
CliBootstrapTests.cs (2)
184using var identity = WindowsIdentity.GetCurrent();
Configuration\ConfigurationHelperTests.cs (2)
199using var identity = WindowsIdentity.GetCurrent();
Secrets\SecretStoreResolverTests.cs (2)
468using var identity = WindowsIdentity.GetCurrent();
Aspire.Hosting (2)
src\Shared\SocketPermissionHelper.cs (2)
136using var identity = WindowsIdentity.GetCurrent();
Aspire.Hosting.Azure.EntraId (4)
LocalDeveloperCertificateStore.cs (4)
28using var identity = WindowsIdentity.GetCurrent(); 132using var identity = WindowsIdentity.GetCurrent();
Aspire.Hosting.Azure.EntraId.Tests (1)
LocalDeveloperCertificateTests.cs (1)
226Assert.Equal(WindowsIdentity.GetCurrent().User, rule.IdentityReference);
Aspire.Hosting.Native.Server (2)
src\Shared\SocketPermissionHelper.cs (2)
136using var identity = WindowsIdentity.GetCurrent();
Aspire.Hosting.RemoteHost (4)
JsonRpcServer.cs (2)
146using var identity = WindowsIdentity.GetCurrent();
src\Shared\SocketPermissionHelper.cs (2)
136using var identity = WindowsIdentity.GetCurrent();
Aspire.Hosting.Tests (10)
Terminals\Hex1bPtySocketTests.cs (4)
85using var identity = WindowsIdentity.GetCurrent(); 287using var identity = WindowsIdentity.GetCurrent();
Utils\SocketPermissionHelperTests.cs (6)
38using var identity = WindowsIdentity.GetCurrent(); 139using var identity = WindowsIdentity.GetCurrent(); 568using var identity = WindowsIdentity.GetCurrent();
Aspire.TerminalHost (2)
src\Shared\SocketPermissionHelper.cs (2)
136using var identity = WindowsIdentity.GetCurrent();
Aspire.TerminalHost.Tests (2)
TerminalHostAppTests.cs (2)
1425using var identity = WindowsIdentity.GetCurrent();
Aspire.Tray.Tests (7)
src\Aspire.Tray\Windows\SingleInstance.cs (2)
66using var identity = WindowsIdentity.GetCurrent();
src\Aspire.Tray\Windows\WindowsTrayLauncher.cs (3)
220using (var shellIdentity = new WindowsIdentity(token.DangerousGetHandle())) 221using (var currentIdentity = WindowsIdentity.GetCurrent())
WindowsSingleInstanceTests.cs (2)
17using var identity = WindowsIdentity.GetCurrent();
csc (4)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
700var currentIdentity = WindowsIdentity.GetCurrent();
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (2)
71var currentIdentity = WindowsIdentity.GetCurrent();
dotnet-aot (2)
parent\dotnet\Commands\Test\MTP\TestApplication.cs (2)
455using 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)
928if (transportType == HttpTransportType.LongPolling && connection.User?.Identity is WindowsIdentity) 1001return user?.Identities.Any(static identity => identity is WindowsIdentity) == true; 1009if (oldContext.User.Identity is WindowsIdentity windowsIdentity) 1016newContext.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)
189var 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 (3)
BackEnd\CommunicationsUtilities.cs (1)
677new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator))
MultiThreadedTaskEnvironmentDriver.cs (2)
176using WindowsIdentity identity = WindowsIdentity.GetCurrent();
Microsoft.Build.Tasks.CodeAnalysis (4)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
700var 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)
700var 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)
parent\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) 346public static WindowsIdentity GetCurrent() 353public static WindowsIdentity? GetCurrent(bool ifImpersonating) 360public static WindowsIdentity GetCurrent(TokenAccessLevels desiredAccess) 371public static WindowsIdentity GetAnonymous() 812internal static WindowsIdentity? GetCurrentInternal(TokenAccessLevels desiredAccess, bool threadOnly) 966private static string? GetAuthType(WindowsIdentity identity) 974/// Returns a new instance of <see cref="WindowsIdentity"/> with values copied from this object. 1008/// 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)
797using (WindowsIdentity self = WindowsIdentity.GetCurrent())
vbc (4)
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (2)
700var 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)
700var currentIdentity = WindowsIdentity.GetCurrent();
src\roslyn\src\Compilers\Shared\NamedPipeUtil.cs (2)
71var currentIdentity = WindowsIdentity.GetCurrent();