- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经设置了一个 ADAM 实例并添加了一些测试用户。在 c# 中,我可以使用 Windows 帐户绑定(bind)到 ADAM,但我无法使用其中一个 ADAM 用户进行绑定(bind)。 (我可以在 ldp 中成功绑定(bind) adam 用户)并且我已通过将 msDS-UserAccountDisabled 属性设置为 false 来确保启用了用户。当我绑定(bind)我的 Windows 帐户时,我可以成功搜索并恢复 ADAM 用户的属性,但我仍在努力验证它们,当我尝试绑定(bind) ADAM 用户帐户时,出现错误:
错误:System.Runtime.InteropServices.COMException (0x8007052E):登录失败:未知用户名或错误密码。在 System.DirectoryServices.DirectoryEntry.Bind( bool throwIfFail)
这是我使用的代码:
string userName = txtUserName.Text;
string password = txtPassword.Text;
string ADConnectionString = "LDAP://localhost:389/CN=sandbox,DC=ITOrg";
DirectoryEntry entry = new DirectoryEntry(ADConnectionString);
entry.Username = "myComputer\\Administrator";
entry.Password = "myPassword";
try
{
DirectorySearcher searcher = new DirectorySearcher(entry);
searcher.Filter = "(&(objectClass=user)(CN=" + userName + "))";
SearchResultCollection result = searcher.FindAll();
if (result.Count > 0)
{
//bind with simple bind
using (DirectoryEntry de = new DirectoryEntry(result[0].Path, userName, password,AuthenticationTypes.None))
{
if (de.Guid != null) // this is the line where it dies
{
Label1.Text = "Successfully authenticated";
Label2.Text = result[0].Properties["displayName"][0].ToString();
Label3.Text = result[0].Properties["telephoneNumber"][0].ToString();
} else
{
Lable1.Text = "Unable to Authenticate";
}
}
}
else
{
Lable1.Text = "UserName :" + userName + " not found";
}
} catch(Exception ex)
{
Label1.Text = "Error searching: " + ex.ToString();
}
在此先感谢您的帮助,非常感谢!
最佳答案
可能是用户名格式问题。在 SDS 中验证 ADAM 用户时,必须使用 LDAP 简单绑定(bind)并使用 ADAM 支持的名称格式。 ADAM 在技术上也允许您使用摘要身份验证,但这在 SDS 中不可用(仅 SDS.Protocols),因此这不适用于您的代码方法。
您正在使用简单绑定(bind),因为您设置了 AuthenticationTypes.None,所以该部分没问题。可能错误的部分是用户名格式。
ADAM 接受用户的完整 DN、他们的显示名称(如果已设置且唯一)和/或 userPrincipalName(如果已设置且唯一)作为“可绑定(bind)”用户名,因此从用户的完整 DN 开始,看看是否可行.如果是这样,您也可以尝试其他用户名值。请注意,您可以在 ADAM 中为 displayName 或 userPrincipalName 放置任何内容。没有验证。只需确保值是唯一的。
如果您真的想针对 ADAM 执行某种类型的绑定(bind)身份验证操作,您将通过使用 .NET 3.5 中 PrincipalContext 的 ValidateCredentials 方法获得更好的性能和规模。
此类内容在 http://www.directoryprogramming.net 的论坛中进行了记录和讨论。一直以来都是我经常光顾的地方,因为它是我的网站。 :) 一位 friend 向我透露了这篇文章,否则我永远不会看到它。
关于c# - 从 C# 中针对 ADAM 对 ADAM 用户进行身份验证 - 无法绑定(bind),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/864015/
ADAM 的并发连接数是否有限制。是可配置的吗? -- 可以建立多少来自同一用户的并发连接?-- 可以建立多少个来自不同用户的并发连接? 任何帮助/指点将不胜感激。 谢谢。 最佳答案 理论限制是 65
我最初在 Keras 中开发了一个分类器,我的优化器很容易在其中应用衰减。 adam = keras.optimizers.Adam(decay=0.001) 最近我试图将整个代码更改为纯 Tenso
我已经设置了一个 ADAM 实例并添加了一些测试用户。在 c# 中,我可以使用 Windows 帐户绑定(bind)到 ADAM,但我无法使用其中一个 ADAM 用户进行绑定(bind)。 (我可以在
我一直在试用 TensroFlow v2 beta 并且我正在试用 tf.keras 模型。 当我编译模型并将优化器选择为字符串 'adam' 时。可以正确训练模型: model.compile(op
由于Adam Optimizer保留了一对移动平均值,例如梯度的均值/方差,因此我想知道它应该如何正确处理权重衰减。我已经看到了两种实现方法。 仅基于客观损失从梯度中更新均值/方差,在每个小批量中明确
我正在尝试估计收缩压。我将 PPG 特征 (27) 放入 ANN 中。我得到的结果如下。这是一个好的学习率吗?如果不是,是高还是低?这是我的结果。 我将学习率设置为 0.000001。我认为还是太高了
我正在尝试使用 .Net 中的 DirectorySearcher 来查询残疾用户。 我正在使用一个与此处发布的非常相似的相当快的列表功能。 Enumerating Large Groups With
根据Adam的伪代码: 我写了一些代码: from matplotlib import pyplot as plt import numpy as np # np.random.seed(42) nu
根据Adam的伪代码: 我写了一些代码: from matplotlib import pyplot as plt import numpy as np # np.random.seed(42) nu
我正在使用 Tensorflow Adam 方法来优化随机函数,该函数(几乎)与神经网络无关,而是与概率推理有关。 Adam 在寻找成本函数的全局最优值方面工作得很好,但是我的变量是有界的,而 Ada
我正在学习如何使用优化器在 Tensor Flow 中训练模型。因此,我构建了一个线性模型,创建了一个玩具数据集,并使用 AdamOptimizer 和 GradientDescentOptimize
好吧,我一直在阅读一些有关 tensorflow 中 AdamOptimizer 的帖子。我认为至少在像我这样的神经网络初学者中存在一些困惑。 如果我理解正确的话,tf.train.AdamOptim
我正在学习 Python 深度学习类(class),但我陷入了示例的以下几行内容: regressor.compile(optimizer = 'adam', loss = 'mean_squared
我正在训练我的方法。我得到的结果如下。这是一个好的学习率吗?如果不是,是高还是低?这是我的结果 lr_policy: "step" gamma: 0.1 stepsize: 10000 power:
我正在编写一个使用 Active Directory 来验证用户的网站。我无权访问我可以以任何方式编辑的 Active Directory 实例。 我听说有些人正在使用 Active Director
我正在开发一个在 div 中带有 iframe 的网页。即使在 CSS 中将宽度设置为 100% 后,我也无法使 iframe 拉伸(stretch)到其父 div 的整个宽度。 我做错了什么。请看看
我在编写一些 Java 代码时遇到问题,这些代码将在 ADAM 中创建一个容器/文件夹,其中容器名称和专有名称包含正斜杠。 例如 cn=测试/测试 dn=CN=测试/测试,CN=TestStore,D
是否每个人都以编程方式创建过自定义属性? (目前我只是使用了 Scheme 管理单元) 理想情况下,我希望(管理员)用户能够通过 Web 界面管理 ADAM 实例。我正在编写 Web 服务以能够执行诸
我正在尝试运行 AdamOptimizer 进行一步训练,但未成功。 optimizer = tf.train.AdamOptimizer(learning_rate) init = tf.globa
考虑以下信息: 初始学习率:0.0002 衰减系数:0.7 ephocs:70 我的问题是选择衰减步骤,使衰减每两个时期发生一次。我该如何在 Keras 中解决这个问题? 这是指数衰减学习率的公式:
我是一名优秀的程序员,十分优秀!