【问题标题】:Authentication Types when switching from System.DirectoryServices to DirectoryServices.Protocols从 System.DirectoryServices 切换到 DirectoryServices.Protocols 时的身份验证类型
【发布时间】:2011-07-01 18:18:24
【问题描述】:

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

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

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

【问题讨论】:

    标签: .net active-directory ldap directoryservices


    【解决方案1】:

    看来你是在正确的轨道上。

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

    无:AuthType.Basic

    安全:AuthType.Negotiate

    匿名:AuthType.Anonymous

    签名:LdapSessionOptions.Signing

    密封:LdapSessionOptions.Sealing

    SecureSocketLayer:LdapSessionOptions.SecureSocketLayer

    加密:与 SecureSocketLayer 的值相同

    ReadonlyServer:LdapSessionOptions.LocatorFlag.WriteableRequired = false

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

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

    委托:未找到相应的设置。委托可能是隐含的。一种测试方法是转换this page 上的代码并查看它是否有效。

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

    【讨论】:

    • FastBind 仍然适用,您在连接的 SessionOptions 中使用 FastConcurrentBind() 方法。很好的答案!
    • @Jakub - FastConcurrentBind 与 FastBind 不同。见this document
    • 根据this document 看来,FastConcurrentBind 和 FastBind 具有相同的基本目的(加速性能),虽然非常好,但它们做不同的事情。
    • @Artomegus - 我有一个关于authenticating on non-AD servers 的问题(具体来说是Novell)。您提到 AuthType.Negotiate 是特定于 Windows 的。 您知道 Novell 会接受什么吗?
    猜你喜欢
    • 1970-01-01
    • 2021-05-09
    • 1970-01-01
    • 1970-01-01
    • 2013-01-05
    • 1970-01-01
    • 1970-01-01
    • 2015-10-16
    • 2013-10-30
    相关资源
    最近更新 更多