更改程序集运行的标识

发布于 2024-10-04 03:36:55 字数 168 浏览 2 评论 0原文

我有一个从我的 asp.net 网站中调用的程序集。

我希望程序集在与 Windows 身份验证主站点运行的用户不同的用户下运行。

原因是,程序集需要管理员权限 - 但我不希望整个网站/IIS 以管理员身份运行。

这可能吗?

提前致谢,

吉姆

I have an assembly which I call from within my asp.net web site.

I want the assembly to run under a different user than the -windows authenticated - main site runs under.

The reason is, the assembly needs admin permissions - but I don't want the whole website/IIS to be running as an administrator.

Is this possible?

Thanks in advance,

Jim

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

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

发布评论

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

评论(2

愁以何悠 2024-10-11 03:36:55

我的猜测是,程序集必须在另一个进程中运行才能使用不同的凭据。

以下是如何在 .net 中启动另一个进程的示例
http://www.csharp-station.com/HowTo/ProcessStart.aspx

然后该进程可以在所需的任何权限下运行。

如果是这种情况,您将必须协调您的网站和其他进程之间的交互。

这很可能使用 WCF 来完成

My guess would be that the assembly would have to run in another process in order to use different credentials.

Here's an example of how to kick off another process in .net
http://www.csharp-station.com/HowTo/ProcessStart.aspx

Then that process could run under whatever permission required.

If that's the case you will have to coordinate the interaction between your website and the other process.

This would most likely be done using WCF

请持续率性 2024-10-11 03:36:55

是的,你可以做到这一点,你需要使用模拟机制。
您可以使用关键字 asp.net 模拟在 Stack Overflow 和 MSDN 上找到各种资源。

您必须使用不同的帐户运行的程序集将位于何处?
它会加载到您的 Asp.Net 应用程序的现有 AppDomain 中吗?

干杯!

Yes you can do that,you need to use the impersonation mechanism.
You can find tones of resources on Stack Overflow and MSDN using keywords asp.net impersonation.

Where will be located this assembly you'll have to run with a different account?
Will it be loaded within your existing AppDomain of you Asp.Net app?

Cheers!

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