草庐IT

validateCredentials

全部标签

go - 我的 bcrypt 密码验证总是失败,说 hashedPassword 不是给定 passwordPASS 的散列

funcvalidateCredentials(attemptedPasswordstring,actualPasswordHashstring)(bool,error){iferr:=bcrypt.CompareHashAndPassword([]byte(actualPasswordHash),[]byte(attemptedPassword));err!=nil{fmt.Printf("validateCredentialserroris%v",err)returnfalse,nil}returntrue,nil}我编写了一个如下所示的测试:funcTestAuth_valida

c# - PrincipalContext.ValidateCredentials 在 XP 上始终使用 Machine ContextType 返回 False

我正在使用PrinciaplContext.ValidateCredentials来针对本地计算机验证一组凭据:stringaccount=Context.ReadLine();stringpass=Context.ReadLine();using(varcontext=newPrincipalContext(ContextType.Machine)){boolvalid=context.ValidateCredentials(account,pass);Console.WriteLine("valid:"+(valid?"true":"false"));}控制台应用程序以管理员身份执

c# - 方法在应该返回 'true' 时返回 'false'

我正在使用ActiveDirectoryDirectoryServices.AccountManagementAPI,并尝试使用以下代码连接到服务器:PrincipalContextprincipalContext=newPrincipalContext(ContextType.Domain,(server+":"+port),loginUsername,loginPassword);我要做的第一件事是检查loginUsername和loginPassword是否有效并且在ActiveDirectory实例中具有足够的权限。为此,我调用以下方法:boolx=principalConte

c# - 使用 PrincipalContext.ValidateCredentials 对本地计算机进行身份验证时出错?

我有一个包含Login的WCF服务根据本地计算机凭据验证用户名和密码的方法,在看似随机的一段时间后,它将停止对某些用户起作用。实际的登录命令是这样的:publicUserModelLogin(stringusername,stringpassword,stringipAddress){//Verifyvalidparametersif(username==null||password==null)returnnull;try{using(varpContext=newPrincipalContext(ContextType.Machine)){//Authenticateagainst

c# - ValidateCredentials 为未知用户返回 true?

我在使用PrincipalContext.ValidateCredentials时看到一些奇怪的行为。该设置是父/子设置中的两个ActiveDirectory域(因此我们有主域company.com和子域development.company.com)。当我根据主域验证凭据时,ValidateCredentials的行为符合预期,对于良好的用户/密码对返回true,对于其他任何内容返回false。但是,如果我验证子域中的用户,ValidateCredentials会为良好的用户名/密码和无效用户返回true。如果我向有效用户提供无效密码,它会正确返回false。现在我正在通过首先执行U

c# - PrincipalContext.ValidateCredentials 总是返回 FALSE

我有一个MVC应用程序需要根据ActiveDirectory登录和验证用户。我正在使用PrincipalContext.ValidateCredentials方法,但始终获得false的身份验证。连接到服务器没问题。问题似乎出现在ValidateCredentials中。这是我的代码:publicstaticboolIsAuthenticated(stringdomain,stringusername,stringpwd){boolIsAuthenticated=false;try{PrincipalContextinsPrincipalContext=newPrincipalCont

php - Laravel 覆盖 EloquentUserProvider 以更改 validateCredentials() 中的密码字段名称

我已经通过覆盖各种类/方法设法更改了代码中的密码字段。但是我在尝试覆盖EloquentUserProvider和它的validateCredentials()方法后,我不断收到错误-ErrorExceptioninAuthUserProvider.phpline15:Argument1passedtoApp\Providers\AuthUserProvider::__construct()mustbeaninstanceofApp\Helpers\Sha1Hasher,instanceofIlluminate\Foundation\Applicationgiven我创建了一个覆盖App