Tag: 代表团

假冒和授权

我正在使用模拟用于访问UNC共享上的文件,如下所示。 var ctx = ((WindowsIdentity)HttpContext.Current.User.Identity).Impersonate(); string level = WindowsIdentity.GetCurrent().ImpersonationLevel); 在使用IIS6的两台Windows 2003服务器上,我获得了不同的模拟级别:一台服务器上的委派和另一台服务器上的模拟 。 这会导致我无法以“模拟”级别访问服务器上的UNC共享的问题。 什么可能导致这种差异? 我搜索了应用程序池,站点和虚拟目录的machine.config和IIS设置 – 但无法找到此问题的原因。

LogonUser和委托

我正在使用LogonUser win32 api: token = LogonUser(…) WindowsIdentity newId = new WindowsIdentity(token); WindowsImpersonationContext impersonatedUser = newId.Impersonate(); 但是,在此之后调用WCF服务时,我无法使用模拟身份。 我认为这是因为impersonatedUser.ImpersonationLevel等于模拟。 这是什么原因? 是ImpersonationLevel.Identification的级别我需要什么? 如何获得这样的水平?