ASP.NET Forms Authentication and Active Directory Impersonation
I'm writing an web application (in C#) where I need to logon to a web page using different credentials to the user logged on locally to Windows. That page the executes a process on the web server but it executes as the user that has logged into the web page. The user logging into the web page is authenticated against Active Directory. I've used Windows Authenication and ASP.NET impersonation to launch processes on the web server, and I can create a site that uses forms authentication against AD, however I can't find a good article that explains how to run a process impersonating a user that have logged on using forms authentication from AD. Whenever I run anything it just give me an error because it's trying to run as 'NT AUTHORITY\IUSR'. Does anyone know 开发者_运维技巧of any good articles, or can you give me any code examples?
Thanks in advance,
Rich
take a look at ProecessStartInfo
- you can setup security etc. (if your thread is already running impersonated then you can get some of the necessary info from System.Threading.Thread.CurrentThread
/CurrentPrincipal
) and then call Preocess.Start
.
精彩评论