我需要在Active Directory上设置SSL.我google了很多但是找不到关于如何做到这一点的体面的写作.如果你知道一些关于此的好资源,请告诉我.谢谢!
我正在尝试在我的MVC应用程序中使用AD LDS进行用户身份验证.我设法写了一些代码,允许我创建/编辑/删除用户和组,但我似乎无法验证它们.这是我的示例代码:
using( var context = new PrincipalContext(ContextType.ApplicationDirectory, "Lenovo_T61-LapT",
"CN=Kontrahenci,DC=TestApp,DC=local"))
{
var userName = "avg.joe";
var email = "avg.joe@smwhr.us";
var password = "123456";
var user = new UserPrincipal(context)
{
Name = userName,
EmailAddress = email
};
user.SetPassword(password);
user.Save();
if (context.ValidateCredentials(userName , password, ContextOptions.SimpleBind))
Console.WriteLine("Hooray!");
user.Dispose();
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,这永远不会得到"Writeline"只给出一个密码或用户名不正确的错误.
我玩过ContextOptions但没有任何运气.
有任何想法吗?