Impersonation is a process whereby an application assumes another identity or security context during execution.
Questions tagged [impersonation]
1522 questions
10
votes
2 answers
How can I get elevated permissions (UAC) via impersonation under a non-interactive login?
I have a class library that keeps system-wide configuration data in the registry (HKLM\Software\XXX). This library is used in various applications (services, windows forms, web apps, console apps) on various versions of Windows (XP, 2003, 7, 2008…

Jeff Shepler
- 2,007
- 2
- 22
- 22
10
votes
3 answers
Is passing a windows security token between processes permitted
Imagine I have an existing process running under windows as a particular user. Would it be permitted for that process to take its current token (with something like OpenThreadToken and DuplicateTokenEx), pass it to another process on the same…

Matt Sheppard
- 116,545
- 46
- 111
- 131
10
votes
2 answers
SQL Server Impersonation and Connection Pooling
I've been given the task of writing an web interface for a legacy database we have where all users have database accounts and are assigned roles accordingly (we have triggers all over the place recording when users do certain things, all based on…

Chris Pfohl
- 18,220
- 9
- 68
- 111
10
votes
1 answer
How to impersonate a user from a service correctly?
I'm working a service, which should impersonate the logged on user.
My code so far, with basic error handling:
// get the active console session ID of the logged on user
if ( !WTSQueryUserToken( WTSGetActiveConsoleSessionId(), &hToken ) )
{
…

kampi
- 2,362
- 12
- 52
- 91
10
votes
4 answers
Can I use token based authentication with active directory?
I want to be able to securely logon to a system without having to type in username password from a windows pc on active directory. The idea is that I (the client software, running on a logged on windows machine) have some sort of token that will…

Chilly
- 325
- 3
- 4
- 12
10
votes
1 answer
Access denied impersonating current user accessing network folder
Trying to list the directories and files within a specific folder. This folder will depend on the current user (Page.User) which logs in by Windows Authentication (NTLM) and is retrieved from the Active Directory (homedirectory property).
I am using…

Perbert
- 465
- 1
- 7
- 17
9
votes
4 answers
Error with SQL Server "EXECUTE AS"
I've got the following setup:
There is a SQL Server DB with several tables that have triggers set on them (that collect history data). These triggers are CLR stored procedures with EXECUTE AS 'HistoryUser'. The HistoryUser user is a simple user in…

Vilx-
- 104,512
- 87
- 279
- 422
9
votes
2 answers
Impersonate a membership user in ASP.NET
In a generic asp.net website with Membership, Roles and hashed passwords enabled, I would like to provide the administrators with impersonation so that they may browse the website as that user would. The website should function as if that user is…

Vaibhav Garg
- 3,630
- 3
- 33
- 55
9
votes
2 answers
Use QueueBackgroundWorkItem with User Identity?
I am using HostingEnvironment.QueueBackgroundWorkItem to run work in the background of an ASP.Net application, based on Scott Hanselman's blog post How to run Background Tasks in ASP.NET.
I'd like to run the background task as the current user's…

Phil Sandler
- 27,544
- 21
- 86
- 147
9
votes
1 answer
IIS 7.5, ASP.NET, impersonation, and access to C:\Windows\Temp
Summary: One of our web applications requires write access to C:\Windows\Temp. However, no matter how much I weaken the NTFS permission, procmon shows ACCESS DENIED.
Background (which might or might not be relevant for the problem): We are using…

Heinzi
- 167,459
- 57
- 363
- 519
9
votes
3 answers
Parallel.ForEach() changes Impersonation Context
Today we deployed our newly created ASP.NET application to the server and soon we realized there was a strange security-related issue which was causing the application to crash. This is an internal application and we use Impersonation to manage how…

Arian Motamedi
- 7,123
- 10
- 42
- 82
9
votes
1 answer
Credentials for ServerManager.OpenRemote
I'm trying to use ServerManager.OpenRemote (from Microsoft.Web.Administration) but am unable to find documentation on how to give it different credentials from the current user. I tried SimpleImpersonation (from How do you do Impersonation in…

Novox
- 774
- 2
- 7
- 24
9
votes
1 answer
Possible to use Impersonation when launching a non-exe process in C#?
I need to be able to run a process as a different user, and I've found plenty of resources and different methods to do this. The problem is, I need to run a non-exe process, e.g. a path with html extension, or in my case,…

vargonian
- 3,064
- 3
- 27
- 36
9
votes
2 answers
Impersonation and NetworkCredential
I need to pass a NetworkCredential object with the credentials of the currently impersonated user to a web service from an asp.net application.
My code looks like this:
WindowsIdentity windowsIdentity = HttpContext.Current.User.Identity as…

Paolo Tedesco
- 55,237
- 33
- 144
- 193
9
votes
1 answer
Impersonation and asynchrony in ASP.NET WebAPI
Update 2
This question originally was "Does impersonation work with Web API?"
And the question to that question is "Yes, it does."
But the problem was not about Web API but impersonation itself. (The description of the problem is below)
But now I'd…

Pavel Voronin
- 13,503
- 7
- 71
- 137