综合安全

发布于 2024-07-09 05:38:45 字数 194 浏览 3 评论 0 原文

是否有托管代码(无需添加 COM 组件或包装调用 C++ 例程)方法来向 C# 托管代码程序集添加集成安全性?

即我想编写一个客户端-服务器系统,其中服务器使用远程处理而不是 IIS,但我希望客户端自动将其凭据传递给服务器,就像浏览器在与启用了集成安全性的 IIS 服务器通信时所做的那样。 ?

这可以吗 如果是这样,哪里有一些例子?

is there a managed code (without adding COM component or wrapped called to C++ routines) way to add integrated security to a C# Managed code assembly?

i.e. I want to write a client-server system where the server uses Remoting instead of IIS, but I want the client to automatically pass it's credentials to the server just like a browser does when communicating with an IIS server that has Integrated security enabled...

Can this be done? and if so, where is there some examples ?

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

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

发布评论

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

评论(4

帅的被狗咬 2024-07-16 05:38:45

否 - 没有 SSPI 的纯托管接口。 但是,有一个 MSDN 示例为您包装 SSPI,然后使用包装器进行远程处理

No - there is no pure managed interface to SSPI. But, there is an MSDN sample that wraps SSPI for you, and then uses the wrapper for remoting.

悟红尘 2024-07-16 05:38:45

.NET 2 有 NegotiateStream,TCP 远程处理使用它来提供 SSPI。

.NET 2 has NegotiateStream which is used by TCP remoting to provide SSPI.

稍尽春風 2024-07-16 05:38:45

有 WCF 和所有 .net 库供您实现类似的功能。 我使用了类似的东西

http://www.theproblemsolver.nl/usingthemembershipproviderinwinforms.htm

并为服务器部分

http://weblogs.asp.net/dwahlin/archive/2007/02/03/video-creating-a-service-with-windows-communication-service-wcf.aspx

这两个开始自己实施的安全集成的步骤很好。

there is WCF and all .net libraries for you to implement something like that. I used something like this

http://www.theproblemsolver.nl/usingthemembershipproviderinwinforms.htm

and for the server part

http://weblogs.asp.net/dwahlin/archive/2007/02/03/video-creating-a-service-with-windows-communication-service-wcf.aspx

those two steps nice to start a own implemented security integration.

短叹 2024-07-16 05:38:45

当您说“远程处理而不是 IIS”时,您到底是什么意思? 远程处理端点(服务器端)通常托管在 IIS 中,因为这为您提供了很多免费的东西,例如身份验证、通过负载平衡进行扩展 - 特别是对于 singlecall 类型对象 - 也就是说,您不想保留状态用于对端点的连续调用。

您可以在 xp/sp2 中的客户端应用程序中使用 http 堆栈来托管远程处理端点,并且可以直接使用 http.sys 驱动程序(顺便说一句,这是自动为您处理的)。

无论如何,对于使用 NTLM 凭据自动登录,我建议您在 IIS 中托管远程处理,并使用 System.Net.CredentialCache.DefaultCredentials 作为客户端应用程序的客户端凭据。 这会将上下文凭据传递到服务器应用程序,假设当前安全区域(内联网/互联网/受信任/等)允许它。

-奥辛

When you say "remoting instead of IIS," what exactly do you mean? A remoting endpoint (the server end) is typically hosted in IIS since this gives you lots of stuff for free, like authentication, scaling through load balancing - especially for singlecall type objects - that is to say, you don't want to keep state for successive calls to the endpoint.

You can host a remoting endpoint using the http stack in a client app also in xp/sp2 and beyond utilising the http.sys driver directly (which is handleded automatically for you btw).

Regardless, for automatic logon with NTLM credentials, I suggest you host remoting in IIS, and use System.Net.CredentialCache.DefaultCredentials for the client's credentials your client app. This will pass the context credentials to the server app, presuming the current security zone (intranet/internet/trusted/etc) allows it.

-Oisin

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