210 questions
2
votes
0
answers
45
views
Can I impersonate a gMSA (managed service account) with LogonUser/WindowsIdentity to test folder write access? [duplicate]
I’m building a Windows installer (WPF, .NET 8) that needs to validate a chosen account (either a domain user or a gMSA) can write to several directories before installation. The simplest way I’ve ...
1
vote
0
answers
76
views
Access Denied When Using WindowsIdentity.RunImpersonated for File Operations
I am trying to perform file operations (upload, download, delete) in a user's file system using impersonation in C#. After researching, I came across the WindowsIdentity.RunImpersonated method, which ...
1
vote
1
answer
518
views
How do I get the/create a WindowsIdentity for a SID using .Net in PowerShell?
Using this in PowerShell will get the WindowsIdentity of myself in PowerShell.
[System.Security.Principal.WindowsIdentity]::GetCurrent()
This will contain the following members
TypeName: System....
0
votes
1
answer
135
views
How Does Netplwiz Get a UserName?
If a Windows username is created in a [email protected] email syntax, the System.Security.Principal.WindowsIdentity.GetCurrent().Name value returned is in the DOMAIN\UserName syntax.
How does Netplwiz ...
1
vote
0
answers
336
views
WindowsIdentity.RunImpersonated not flowing across Task.Run
I have a situation where a (legacy) .Net Framework Web API needs to make an impersonated call into a separately-maintained .Net library. The call will perform a long running (~1 sec) operation, so it ...
0
votes
1
answer
1k
views
User Impersonation not working in .NET Core
We have a web app that runs on our corporate intranet. I get the following error when I try to access a network path in my MVC controller:
Access to the path '\Server001\SharedFiles\CA' is denied.
The ...
2
votes
0
answers
573
views
Impersonating user in remote machine and creating a process as logged in user
We are developing Java web application, it will be deployed and used in the pure Windows platform. Our use case is, couple of licensed Tools/Software in Server needs to be accessed by the associates ...
1
vote
0
answers
1k
views
WindowsIdentity.RunImpersonated not working?
I have a website where I click a button and a process its supposed to start.
The problem is that I have to start that new process with other user and its starting with the user currently running the ...
0
votes
1
answer
232
views
Using WindowsIdentity to connect to ManagementScope(WMI)
I have a .net core application that is hosted on IIS. This application utilizes System.Management to connect to other machines to gather information.
I am noticing that some of my calls are getting an ...
1
vote
0
answers
656
views
.Net Core Impersonation and proxy
I'm trying to authenticate a user so that he can use the MS Graph API. I'm using the Integrated Windows Provider method.
When the application is deployed on a server, it doesn't work, because it's ...
0
votes
1
answer
511
views
Overriding ASP.NET Core Windows Authentication Identity
I was looking to use Windows Authentication for a Blazor Server app, but hit a small issue with the default Identity Name.
i.e. when you used
<AuthorizeView>
Hi @context.User.Identity.Name
&...
2
votes
1
answer
4k
views
Impersonation Middleware in an Asp.Net Core Intranet app for Windows-Identity
Before I explain my problem, here's our scenario:
Scenario
We write software only for our intranet Windows users (currently managed by local Active Directory but in future it is possible we migrate to ...
1
vote
2
answers
1k
views
Convert SessionId to User Account SID _without_ WTSQuerySessionInformation?
I'm working on a service (C#) that receives session-change notifications (specifically SessionLogon). The only piece of information I get with that notification is SessionId.
My ultimate goal is to ...
0
votes
1
answer
872
views
C# ASP.Net Core - Passing Currently logged on Username to API
I want to pick up the user that is currently logged on to my web site, in an API on a different site. I do not want to pass the Username via a parameter for security reasons.
In my REST API I have ...
2
votes
0
answers
286
views
User Impersonation from System Account service
I am Working on creation Windows Service using C#, running from System Account with background services.
I need to perform some task via service which need user login info, which I intend to share ...
0
votes
1
answer
404
views
Obtain windows domain username and unique token/password to pass through service
I have an app that users would run locally on their desktop, which calls into an API on my server externally.
I can obtain the user's Windows domain and name through the WindowsIdentity API. But I'd ...
0
votes
0
answers
52
views
Sending WindowsIndentity to a WebService
I'm trying to send a WindowsIdentity to a Web service, but I have a compilation error I don't understand. Here is a minimal reproducible example:
The folowing method is on the web service:
...
1
vote
1
answer
1k
views
HttpContext.Current.User returns admin account instead of user account
I have two Windows accounts, my regular user-level one, and an Administrator one. As far as I know, there is no connection between the two in AD, other than my name. I normally log into my dev ...
0
votes
0
answers
792
views
WindowsIdentity.Impersonate in ASP.NET randomly “Invalid token for impersonation - it cannot be duplicated"
I have a web application that has an HTML 5 front end that calls (via Ajax & JSON) to a .NET MVC web app. The goal is to allow domain users to automatically authenticate against Active Directory ...
0
votes
1
answer
325
views
Client/Server app, how to create process on remote system as a domain user without transferring that users username/password to the remote system?
I have two systems both running my C# client/server software code. I want to from Computer 1 create a process as a given Active Directory domain user on Computer 2 without having to have my client/...
1
vote
0
answers
369
views
Set Thread.CurrentPrincipal to current WindowsIdentity
I'm writing a console application in C# .Net where i need to do some impersonation of a Windows AD account. I'v managed to set the WindowsIdentity successfully, however there is a certain Login() ...
0
votes
1
answer
444
views
Get logged-in user in html page with C# code and without opening in VS?
We have a pure html page running in our IIS, and we would like to know what logged-in users are accessing the page. By "logged-in" users I mean a user that looged on to our intranet in their Windows ...
5
votes
1
answer
4k
views
How to use System.Security.Principal.WindowsIdentity in .NET Core 2.1
How can we use WindowsIdentity in .NET Core 2.1?
It was available in 2.0
.NET API Browser
https://learn.microsoft.com/en-us/dotnet/api/?term=WindowsIdentity&view=netcore-2.0
WindowsIdentity is ...
14
votes
2
answers
5k
views
User.Identity fluctuates between ClaimsIdentity and WindowsIdentity
I have an MVC site that allows logging in using both Forms login and Windows Authentication. I use a custom MembershipProvider that authenticated the users against Active Directory, the System.Web....
2
votes
2
answers
3k
views
Get name from Windows Identity on IIS
It works locally but when I upload my website to an IIS server then it wont work: this is part of my config file which I thought it would work:
<authentication mode="Windows">
</...