- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在我的 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();
}
最佳答案
所以我找到了我在类似 question 上发布的解决方案.
我所做的,对我有用的是,在调用 ValidateCredentials 时,我稍微修改了用户名:
bool auth = context.ValidateCredentials(
String.Format("CN={0},CN=Kontrahenci,DC=TestApp,DC=loc",
userName),
password);
关于.net - ContextType.ApplicationDirectory 上的 AD LDS ValidateCredentials 无法进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6614962/
首先,我查看了关于 SO 的大多数问题,但似乎都不是完全相同的问题。 Here是一个类似的问题,但并不完全相同。在我的情况下,我正在创建一个 PrincipalContext : Dim pctx A
我在使用 PrincipalContext.ValidateCredentials 时看到一些奇怪的行为。该设置是父/子设置中的两个 Active Directory 域(因此我们有主域 compan
我必须实现一个安全解决方案,根据 ldap/AD 服务器验证用户凭据。 代码是这样的…… using (PrincipalContext context = new PrincipalContext(
我有一个包含 Login 的 WCF 服务根据本地计算机凭据验证用户名和密码的方法,在看似随机的一段时间后,它将停止对某些用户起作用。 实际的登录命令是这样的: public UserModel Lo
我有一个 MVC 应用程序需要根据 Active Directory 登录和验证用户。我正在使用 PrincipalContext.ValidateCredentials 方法,但始终获得 false
我们的应用程序有一个登录框,要求用户输入他们的 AD 凭据。我们获取这些凭据,然后调用 using (PrincipalContext pc = new PrincipalContext(Co
我正在处理两个域 - 一个是可信域。一个域上可能有一个 JohnSmith,另一个域上可能有另一个 JohnSmith。这两个人都需要登录我的应用程序。 我的问题:无论我传入哪个域都没有关系 - 此代
我在安装过程中使用 Windows PowerShell 查询和验证用户的 Windows 凭据。直到昨天,它都运行良好。现在我公司的 IT 部门更改了域 Controller 的一些配置,现在我得到
我已经通过覆盖各种类/方法设法更改了代码中的密码字段。但是我在尝试覆盖 EloquentUserProvider 和它的 validateCredentials() 方法后,我不断收到错误 - Err
我创建了一项服务,该服务使用 System.DirectoryServices.AccountManagement 根据 Active Directory 验证凭据。我需要针对本地域和受信任的域验证凭
我正在尝试在我的 MVC 应用程序中使用 AD LDS 进行用户身份验证。我已经设法编写了一些允许我创建/编辑/删除用户和组的代码,但我似乎无法对它们进行身份验证。这是我的示例代码: using( v
我有以下代码片段来针对 AD 测试纯文本用户名/密码,如果我在 visual studio 中按 F5 并通过 WCFTestClient 尝试它,它工作正常,但是一旦我部署到 IIS 并尝试相同的功
我有一个应用程序,其中用户对我们的 Active Directory 进行身份验证: private bool Authenticate() { using (var context = n
我有一个现有项目使用以下内容在开发机器上进行本地身份验证 principalContext.ValidateCredentials("bondjames", "drno", ContextOption
我正在使用 IIS 6.0 托管 WCF Web 服务。我的应用程序池在本地管理员帐户下运行,并且我定义了其他本地用户来访问 Web 服务。我编写了以下代码来验证用户: //Any public st
我正在使用 PrinciaplContext.ValidateCredentials 来针对本地计算机验证一组凭据: string account = Context.ReadLine(); stri
最初问题始于 .NET\C# 和 ValidateCredentials方法 - 没有 SSL 它工作,使用 SSL 它返回“服务器无法处理目录请求”。但我缩小了范围并简化为下面发布的 C++ 代码。
在我的 LoginController 中的 Auth 下,我使用了以下代码: namespace App\Http\Controllers\Auth; use App\Model\Admin; us
我是一名优秀的程序员,十分优秀!