【发布时间】:2014-12-19 09:12:47
【问题描述】:
我正在尝试连接到 LDAP 以对用户进行身份验证。这是我的代码,但我无法使用我的 c# 代码设置 SSL。
using LdapConnection = Novell.Directory.Ldap.LdapConnection;
using LdapException = Novell.Directory.Ldap.LdapException;
var ldapHost = WebConfigurationManager.AppSettings["LDAP_HOST"];
var ldapPort = WebConfigurationManager.AppSettings["LDAP_PORT"];
connection.Connect(ldapHost, Convert.ToInt32(ldapPort));
sb = new StringBuilder();
sb.Append(ldapLocation).Append(userName).Append(",").Append(ldapLocationIndia);
connection.Bind(LdapConnection.Ldap_V3, sb.ToString(), password);
我从我的应用程序安全团队收到一条消息,我正在发送纯密码,因此我尝试通过尝试设置选项来将身份验证类型设置为安全以保护该密码
connection.SessionOptions.SecureSocketLayer = true;
但我在连接对象中没有看到任何 Sessionoption,我正在使用 Novel.ldap dll 进行 LDAP 操作。
有没有人帮帮我?如何通过网络以安全的方式发送密码以供 ldap 服务器进行身份验证。
我使用的是 636 端口。
提前致谢
【问题讨论】:
-
你熟悉谷歌吗? Connect to LDAP using SSL
-
你好,我试过了,我的问题是我没有在我的连接对象中获得 sessionopions 属性。这是我的问题。
-
@DJKRAZE 这个例子使用的是
System.DirectoryServices.Protocols.LdapConnection而不是Novell.Directory.Ldap.LdapConnection。
标签: c# .net asp.net-mvc ldap