active-directory - DirectorySearcher() 和 AuthenticationTypes 枚举
问题描述
使用参数实例化DirectorySearcher(doman,...)时,您可以指定AuthenticationTypes。但是,在没有参数的情况下实例化DirectorySearcher()时,不清楚将使用 什么AuthenticationTypes 。
现在这是一件大事,因为使用 NTLM 的AuthenticationTypes.secure将在接下来的几个月被 MS 在 MS AD 服务器上废弃和禁用。这让开发人员争先恐后地取消他们的 SW
我的猜测是在没有参数的情况下实例化 DirectorySearcher() 时,调用代码会找到第一个合适的 AuthenticationType,因此现有代码不会中断。但我想确认..
解决方案
默认值为AuthenticationTypes.Secure
,您可以从源代码或检查AuthenticationType
属性中看到:
Console.WriteLine(new DirectoryEntry().AuthenticationType);
但是,AuthenticationTypes.Secure
不只是尝试 NTLM。文档说:
请求安全身份验证。设置此标志时,WinNT 提供程序使用 NTLM 对客户端进行身份验证。Active Directory 域服务使用 Kerberos,可能还有 NTLM,对客户端进行身份验证。当用户名和密码为空引用(
Nothing
在 Visual Basic 中)时,ADSI 使用调用线程的安全上下文绑定到对象,该安全上下文是运行应用程序的用户帐户或客户端的安全上下文调用线程正在模拟的用户帐户。
对于 Active Directory 域服务,它实际上更喜欢 Kerberos 而不是 NTLM。
推荐阅读
- excel - 从姓名和员工 ID 中查找员工 ID,并在下一个单元格中显示姓名
- html - CSS 倾斜图案重复 - 幻灯片菜单
- regex - Roboframework - 正则表达式语法
- python - SPSS风格的“集群”条形图,使用python和pandas在多列中计数
- ios - 在没有 App Store 的情况下为 iOS 部署 React Native 应用程序
- ssh - SSH 端口转发没有 SSH 进程死亡?
- laravel - 使用 Laravel Storage Facade 访问另一台 PC 上的文件
- python - 没有列表的重复元素
- javascript - 未提及 Discord.js 用户
- django - 带有 Firebase 的 django DRF 需要访问 request._request