Questions tagged [impersonation]

Impersonation is a process whereby an application assumes another identity or security context during execution.

1522 questions
4
votes
1 answer

User impersonation with asp.net forms authentication

I've written a small ASP.NET 3.5 application to allow users to update selected account attributes on their own. Everything works fine when I use Basic Authentication, but because the dialog that is presented is less than ideal, I'd like to use forms…
4
votes
1 answer

LogonUser returns true for a wrong password

bool bRet=LogonUser(strUserName, L"", strPassword, LOGON32_LOGON_TYPE_NEW_CREDENTIALS, LOGON32_PROVIDER_WINNT50, &phToken) bRet always returns true even if I enter a wrong password when there is no domain. Is there any work around like if I…
Deepak
  • 377
  • 4
  • 14
4
votes
2 answers

How does asp.net impersonation work with System.Threading.Task?

I want to access a database with the credentials of the client user. my code: Task.Run(() => { // Connect to DB. } I have the identity tag with impersonation attribute in the system.web node: I have the…
Chris Hayes
  • 3,876
  • 7
  • 42
  • 72
4
votes
1 answer

Symfony impersonation - separate firewalls and separate user providers

I have a Symfony application with two firewalls, one for admins and one for normal users. admin: provider: admin # etc main_site: form_login: provider: fos_userbundle csrf_provider: form.csrf_provider I'd like admin…
Sam
  • 5,997
  • 5
  • 46
  • 66
4
votes
2 answers

Solution to avoid double-hop from client > web service > SQL Server

My project invoves a user connecting from client to web service, and then web service to SQL Server. The web services and SQL Server are on separate machines. Because of security requirements, we cannot used mixed mode in SQL Server, only Windows…
8kb
  • 10,956
  • 7
  • 38
  • 50
4
votes
2 answers

ASP.Net Identity losing Impersonation

I'm having a lot of problems that whenever I call an ASP.Net Identity Async method I get access denied exceptions from SQL server. The following returns a user: var user = (from u in ctx.Users where u.Id == 1 select…
Mog0
  • 1,689
  • 1
  • 16
  • 40
4
votes
0 answers

Cast UserPrincipal to WindowsIdentity

I've created a WCF service to authorize my apps through AzMan services. I've been trying to cast an UserPrincipal to WindowsIdentity by many ways. My scenario is: A Web MVC calling a WCF service which needs to pass a windows identity variable to an…
gandarez
  • 2,609
  • 4
  • 34
  • 47
4
votes
2 answers

LogonUser using LOGON32_LOGON_NEW_CREDENTIALS works against remote untrusted domain machine

So between the two machines, there is no trust - they are in different domains. I've successfully connected to the remote machine using LogonUser API using logon type, LOGON32_LOGON_NEW_CREDENTIALS. I am able to retrieve the content of a directory…
Jiho Han
  • 1,610
  • 1
  • 19
  • 41
4
votes
1 answer

how to use hashed password in impersonate of ASP.NET

I have an ASP.NET application that requires impersonation as an administrator user. In web.config: The customer complained about saving the password in clear text format.…
ala
  • 7,070
  • 13
  • 47
  • 54
4
votes
1 answer

RW access to shared Windows folder using different user credentials in .NET

We are working in Windows network (AD in use) We have folder shared by user (access limited for this user only) User credentials are known I need to access to that share inside my app. Note I've read about Impersonation but what I can do is open…
Maciej
  • 10,423
  • 17
  • 64
  • 97
4
votes
1 answer

SQL Server: EXECUTE AS clause of stored procedure not granting sysadmin permissions

I developped a stored procedure in order to restore a database from a backup file and add an application user to it. This stored procedure belongs to the master database. The issue is that my IT department does not allow me to use an admin user,…
4
votes
2 answers

FileSystemWatcher running under impersonated user

I have an c# winform application that runs under a local account but needs to monitor folders on a domain. I am using slightly modified code from here to copy the files and that works fine. Can similar code be used with the FileSystemWatcher set…
AdmSteck
  • 1,753
  • 15
  • 25
4
votes
3 answers

Permissions issue when trying to read/write file in ASP.NET application

We have a .net web application. The web application is setup in IIS and runs under an AppPool which runs under Domain\User1 This web application has C#.NET code that makes access to a file on server. Problem is that only Domain\User2 has rights to…
luckydeveloper
  • 300
  • 2
  • 16
4
votes
0 answers

C# application getting Access is denied. HRESULT: 0x80070005 (E_ACCESSDENIED)

I have the following on my c# code: ConnectionOptions connOptions = new ConnectionOptions(); connOptions.Impersonation = ImpersonationLevel.Impersonate; //connOptions.Authentication = AuthenticationLevel.PacketPrivacy; connOptions.EnablePrivileges =…
user1885581
4
votes
1 answer

User impersonation in java

Using impersonation I tried to read a file located on the network in a shared folder. But I got the error "Access is denied". My source code is given below ... This works fine for local resources. But gives error when access network resources.…
CodeJunkie
  • 113
  • 1
  • 11