impersonation

Impersonation and Delegation

时光总嘲笑我的痴心妄想 提交于 2019-12-03 20:48:57
I am using impersonation is used to access file on UNC share as below. var ctx = ((WindowsIdentity)HttpContext.Current.User.Identity).Impersonate(); string level = WindowsIdentity.GetCurrent().ImpersonationLevel); On two Windows 2003 servers using IIS6, I am getting different impersonation levels: Delegation on one server and Impersonation on the other server. This causes issues where I am unable to access the UNC share on the server with 'Impersonation' level. What could be causing this difference? I searched through machine.config and IIS settings for the app pool, site and virtual

Copy files over network via file share, user authentication

杀马特。学长 韩版系。学妹 提交于 2019-12-03 19:13:52
问题 I am building a .net C# console program to deploy file to a windows file share server (folder that is being shared). The path is :: \\192.168.0.76\htdocs\public On running I am getting the error: [09:35:29]: [Step 1/3] Unhandled Exception: System.UnauthorizedAccessException: Access to the path '\\192.168.0.76\htdocs\public' is denied. [09:35:29]: [Step 1/3] at DeployFileShare.Program.CopyDir(String source, String dest, String[] exclude, Boolean overwrite) [09:35:29]: [Step 1/3] at

Windows Impersonation: A Flaw in the Ointment

╄→гoц情女王★ 提交于 2019-12-03 17:49:52
问题 In my journey to master the nuances of user impersonation in Windows I first had an issue about getting impersonation to a remote database to occur at all (see this SO question) but I finally figured that out. My next hurdle is undoing/cancelling/reverting (choose your favorite verb) impersonation. I have tried a couple different impersonation libraries that seem credible to me: Phil Harding's Impersonator Matt Johnson's SimpleImpersonation The results are identical with both libraries. Best

How to impersonate user using SwitchUserFilter in Spring?

天涯浪子 提交于 2019-12-03 17:47:15
问题 I do not have knowledge on Spring Impersonating user. I have gone through some sample code of configuration for impersonating user and noticed that SwitchUserFilter is used for this implementation. How to implement impersonate user using Spring SwitchUserFilter Filter and how does it works ? What is the internal flow of impersonating user ? In my application I am using spring security also. Can anyone please help me with simple description or any sample example to achieve this ? 回答1: You

How to get Alfresco login ticket without user password, but with impersonating user with user principal name (UPN)

僤鯓⒐⒋嵵緔 提交于 2019-12-03 17:34:58
I'm writing a DLL that has function for getting Alfresco login ticket without using user password, using only a user principal name (UPN). I’m calling alfresco REST API service /wcservice . I use NTLM in Alfresco. I’m impersonating users using WindowsIdentity constructor as explained here http://msdn.microsoft.com/en-us/library/ms998351.aspx#paght000023_impersonatingbyusingwindowsidentity . I checked and user is properly impersonated (I checked WindowsIdentity.GetCurrent().Name property). After impersonating a user, I try to make HttpWebRequest and set its credentials with CredentialsCache

What is the magic to Windows impersonation with LOGON32_LOGON_NEW_CREDENTIALS?

对着背影说爱祢 提交于 2019-12-03 14:42:28
From my reading on user impersonation on Windows, one should properly use the LOGON32_LOGON_NEW_CREDENTIALS logon type for impersonating a user to a database. Using Matt Johnson's nice impersonation wrapper (originally posted here and then polished up here ), I tried to test this out--here is my entire program except for constants defining my particular DOMAIN, USER, PWD, and CONN_STRING. using System; using System.Data.SqlClient; using SimpleImpersonation; namespace ImpersonationDemo { class Program { private static SqlConnection _connection; static void Main(string[] args) { using

Impersonation in IIS 7.0

删除回忆录丶 提交于 2019-12-03 13:35:47
I have a website that works correctly under IIS 6.0: It authenticates users with windows credentials, and then when talking to the service that hits the DB, it passes the credentials. In IIS 7.0, the same config settings do not pass the credentials, and the DB gets hit with NT AUTHORITY\ANONYMOUS. Is there something I'm missing? I've turned ANONYMOUS access off in my IIS 7.0 website, but I can't get the thing to work. These are the settings that I'm using on both IIS 6.0 and 7.0: <authentication mode="Windows"> <identity impersonate="true"> What changed from 6.0 to 7.0? There has been changes

What is the difference: LoadUserProfile -vs- RegOpenCurrentUser

前提是你 提交于 2019-12-03 10:14:14
问题 These two APIs are very similar but it is unclear what the differences are and when each should be used (Except that LoadUserProfile is specified for use with CreateProcessAsUser which I am not using. I am simply impersonating for hive accesss). LoadUserProfile http://msdn.microsoft.com/en-us/library/bb762281(VS.85).aspx RegOpenCurrentUser http://msdn.microsoft.com/en-us/library/ms724894(VS.85).aspx According to the Services & the Registry article: http://msdn.microsoft.com/en-us/library

Accessing mapped drives when impersonating in ASP.NET

喜欢而已 提交于 2019-12-03 09:07:42
Short version : Is it possible or not to use impersonation in ASP.NET to access mapped drives? Long Version: I'm currently using impersonation in ASP.NET to gain access to network files. This is working perfectly for any network file using a UNC path, but it is failing to access any files on mapped drives defined for the user account I'm impersonating. For example, let's say a file lives on the network at \\machine\folder\file.txt , and let's also say that drive S: is mapped to \\machine\folder . We need to be able to access both the full UNC path, \\machine\folder\file.txt , as well as the

ASP.NET PowerShell Impersonation

让人想犯罪 __ 提交于 2019-12-03 08:02:54
I have developed an ASP.NET MVC Web Application to execute PowerShell scripts. I am using the VS web server and can execute scripts fine. However, a requirement is that users are able to execute scripts against AD to perform actions that their own user accounts are not allowed to do. Therefore I am using impersonation to switch the identity before creating the PowerShell runspace: Runspace runspace = RunspaceFactory.CreateRunspace(config); var currentuser = WindowsIdentity.GetCurrent().Name; if (runspace.RunspaceStateInfo.State == RunspaceState.BeforeOpen) { runspace.Open(); } I have tested