.NET Windows 集成身份验证

发布于 2024-07-05 22:48:40 字数 216 浏览 6 评论 0原文

我正在寻找最好/最简单的方法来向现有协议添加扩展(无法轻松更改实际协议),以允许用户在.NET 中进行 Windows 身份验证(NTLM?)。 我已经查看了 AuthenticationManager 类,但它要求我使用 Web(Http)Request 这不是一个选项。 NegotiateStream 是一种选择,因为我想将其集成到现有协议中,而不是将其包装到新协议中。 除了这两个之外,我还有其他选择吗?

I'm looking for the best/easiest way to add extensions to an existing protocol (can't change the actual protocol easily) to allow the user to do windows authentication (NTLM?) in .NET. I looked at the AuthenticationManager class already but it requires that I use Web(Http)Request which isn't an option. NegotiateStream is an option either as I want to integrate this into the existing protocol, not wrap it into a new one. Are there any options besides these two available to me ?

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

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

发布评论

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

评论(2

我还不会笑 2024-07-12 22:48:40

我认为既然你不能执行 HTTPRequest,那么这是一个桌面软件。

Active Directory 和 LDAP 是您最有可能使用的协议。

我认为 System.EnvironmentSystem.DirectoryServices 将是开始的地方。

我喜欢 DirectorySearcherEnvironment.UserName 用于获取有关用户的任何信息。

我希望这有帮助。

I assume since you can't do an HTTPRequest, that this is a piece of desktop software.

Active Directory and LDAP are the protocols you are most likely going to be using.

I think System.Environment, and System.DirectoryServices are going to be the places to look to start.

I like DirectorySearcher, and Environment.UserName for getting just about any information on a user.

I hope this helps.

风吹雪碎 2024-07-12 22:48:40

如果您只能扩展您的协议,那么一种方法是编写您自己的 Stream 类,将其传递给 NegotiateStream,然后只需获取 NegotiateStream 为您提供的消息并放入您自己的协议中,并通过您的协议将响应返回给 NegotiateStream流类。
但如果可能的话,最简单的方法是将整个协议(流)包装在 NegotiateStream 中......

If you can only extend your protocol then one way to do this would be to write your own Stream class that you pass to NegotiateStream and then just take the messages that NegotiateStream gives you and put in your own protocol and give responses back to NegotiateStream through your Stream class.
But if possbile, the easiest way would be to wrap your entire protocol (Stream) inside a NegotiateStream...

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