c# - 无法使用 Novell C# 包在 xamarin.forms 中建立安全 ldap 连接
问题描述
我正在使用 VisualStudio 2019 Xamarin.Forms。我可以用下面的代码建立 ldap 连接。我正在使用 Novell Directory Ldap NetStandard ldap 客户端库。用户可以使用此代码进行身份验证。但是我找不到一种方法来使用公司 ldap 管理员提供的根证书建立安全的 ldap 连接。
using (var cn = new LdapConnection())
{
// connect
cn.SecureSocketLayer = true;
cn.Connect("207.154.211.212", 389); //636 ssl
// bind with an username and password
// this how you can verify the password of an user
try
{
cn.Bind("uid=adam,ou=People,dc=localdomain,dc=local", "423fw342ed23");
Console.WriteLine(" ::: SUCCESS ::: ");
}
catch
{
Console.WriteLine(" ::: LDAP CONNECTION ERROR ::: ");
}
}
解决方案
推荐阅读
- c++ - 添加 cpp11 插件时出现错误消息“未定义对 boost (...) 的引用”
- postgresql - dataframe.to_sql 索引作为 postgresql 中的主键
- c# - 更改场景时 Unity3D 中的奇怪平面行为
- tfs - 如何在 TFS 中从预生产转变为生产升级?
- autodesk-forge - Autodesk 提取器显示错误 #9 - 无可见内容
- c# - 我想在我的电子邮件中嵌入一张图片
- c# - 通过 Service Fabric 反向代理访问 WCF 应用程序
- c# - 任务的 Wait() 方法阻塞任务
- google-bigquery - Wait.on(signals) 在 Apache Beam 中的使用
- hadoop - Sqoop 的语法导入数据库中存在的 100 个表中的 5 个 - 不要使用排除关键字?