ASP.NET 表单身份验证和 Active Directory 模拟

发布于 2024-11-25 09:05:54 字数 349 浏览 1 评论 0原文

我正在编写一个 Web 应用程序(用 C# 编写),我需要使用与本地登录 Windows 的用户不同的凭据登录网页。该页面在 Web 服务器上执行一个进程,但它以已登录该网页的用户身份执行。登录网页的用户将根据 Active Directory 进行身份验证。我已经使用 Windows 身份验证和 ASP.NET 模拟在 Web 服务器上启动进程,并且我可以创建一个针对 AD 使用表单身份验证的站点,但是我找不到一篇好文章来解释如何运行模拟使用 AD 表单身份验证登录的用户。每当我运行任何东西时,它都会给我一个错误,因为它试图以“NT AUTHORITY\IUSR”身份运行。有谁知道有什么好的文章,或者可以给我一些代码示例吗?

预先感谢,

里奇

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长亭外,古道边 2024-12-02 09:05:54

看看ProecessStartInfo - 您可以设置安全性等(如果您的线程已经在模拟运行,那么您可以从System.Threading.Thread.CurrentThread获取一些必要的信息> /CurrentPrincipal),然后调用 Preocess.Start

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文