从 System.DirectoryServices 切换到 DirectoryServices.Protocols 时的身份验证类型

Authentication Types when switching from System.DirectoryServices to DirectoryServices.Protocols(从 System.DirectoryServices 切换到 DirectoryServices.Protocols 时的身份验证类型)
本文介绍了从 System.DirectoryServices 切换到 DirectoryServices.Protocols 时的身份验证类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道 AuthenticationTypes 中的等效 AuthType 值才能从 S.DS 迁移到 S.DS.P 代码.

I need to know the equivalent AuthType values from AuthenticationTypes to migrate from S.DS to S.DS.P code.

我正在重写一个当前使用 System.DirectoryServices 命名空间的 LDAP 连接模块.为了提高与非 ActiveDirectory 服务器的兼容性,我正在尝试重写所有代码以使用 System.DirectoryServices.Protocols(根据.NET 开发人员目录服务编程指南"中的建议).除了在使用 AuthenticationTypes 枚举到 SD.Protocols 使用的 AuthType 枚举之间的转换.我需要知道两者之间的等价物,以便使用旧代码的客户端在发布新代码时不会失去功能.

I am rewriting an LDAP connection module that currently uses the System.DirectoryServices namespace. To increase compatibility with non-ActiveDirectory servers, I am trying to rewrite all of the code to use System.DirectoryServices.Protocols (as per the suggestion in "The .NET Developer's Guide to Directory Services Programming). Everything is going smoothly except for the transition between using the AuthenticationTypes enumeration to the AuthType one used by SD.Protocols. I need to know the equivalents between the two so that clients using the old code do not lose functionality when the new code is released.

我知道的等价物是:
无 -> 基本
安全 -> 协商(或多或少)
匿名 -> 无
SecureSocketsLayer -> 将 LdapSessionOptions.SecureSocketsLayer 设置为 true

The equivalencies that I know of are:
None -> Basic
Secure -> Negotiate (more or less)
Anonymous -> None
SecureSocketsLayer -> setting LdapSessionOptions.SecureSocketsLayer to true

推荐答案

看来你走对了.

经过一些研究,我能够映射几乎所有的 AuthenticationTypes 值:

After doing some research, I was able to map almost all of the AuthenticationTypes values:

无:AuthType.Basic

None: AuthType.Basic

安全:AuthType.Negotiate

Secure: AuthType.Negotiate

匿名:AuthType.Anonymous

Anonymous: AuthType.Anonymous

签名:LdapSessionOptions.Signing

Signing: LdapSessionOptions.Signing

密封:LdapSessionOptions.Sealing

Sealing: LdapSessionOptions.Sealing

SecureSocketLayer:LdapSessionOptions.SecureSocketLayer

SecureSocketLayer: LdapSessionOptions.SecureSocketLayer

加密:与 SecureSocketLayer 的值相同

Encryption: Same value as SecureSocketLayer

ReadonlyServer:LdapSessionOptions.LocatorFlag.WriteableRequired = false

ReadonlyServer: LdapSessionOptions.LocatorFlag.WriteableRequired = false

Serverbind:使用具有 fullyQualifiedDnsHostName 参数的 LdapDirectoryIdentifier 构造函数之一,并将值设置为 true.

Serverbind: Use one of the LdapDirectoryIdentifier constructors that has the fullyQualifiedDnsHostName argument, with the value set to true.

FastBind:不适用,因为此 S.DS.P 在较低级别上工作.

FastBind: Doesn't apply, since this S.DS.P works at a lower level.

委托:未找到相应的设置.委托可能是隐含的.一种测试方法是转换 上的代码这个页面,看看它是否有效.

Delegation: No corresponding setting found. It could be that delegation is implicit. One way to test would be to convert the code on this page and see if it works.

请注意,并非所有非 AD 服务器都支持 AuthType.Negotiate,因为它是特定于 Windows 的.还有一些其他的东西(比如一些 LocatorFlag 值)对于非 AD 系统也没有任何意义.因此,在转换假设 AD 连接的代码时要小心,因为某些假设将不再安全.

Be aware that not all non-AD servers will support AuthType.Negotiate, since it is Windows specific. There are several other things (like some of the LocatorFlag values) that will also not mean anything for non-AD systems. Thus, take care when converting code that assumed AD connectivity, since some assumptions will no longer be safe.

这篇关于从 System.DirectoryServices 切换到 DirectoryServices.Protocols 时的身份验证类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)