48 references to PasswordVerificationResult
Microsoft.AspNetCore.Identity.Test (18)
PasswordHasherTest.cs (17)
59var successResult = hasher.VerifyHashedPassword(null, hashedPassword, "password 1"); 60Assert.Equal(PasswordVerificationResult.Success, successResult); 63var failedResult = hasher.VerifyHashedPassword(null, hashedPassword, "password 2"); 64Assert.Equal(PasswordVerificationResult.Failed, failedResult); 124var result = hasher.VerifyHashedPassword(null, hashedPassword, Plaintext_Password); 127Assert.Equal(PasswordVerificationResult.Failed, result); 143var result = hasher.VerifyHashedPassword(null, hashedPassword, Plaintext_Password); 146Assert.Equal(PasswordVerificationResult.Success, result); 151[InlineData(V2_SHA1_1000iter_128salt_256subkey, PasswordVerificationResult.SuccessRehashNeeded)] 153[InlineData(V3_SHA1_250iter_128salt_128subkey, PasswordVerificationResult.SuccessRehashNeeded)] 154[InlineData(V3_SHA256_250000iter_256salt_256subkey, PasswordVerificationResult.SuccessRehashNeeded)] 155[InlineData(V3_SHA512_50iter_128salt_128subkey, PasswordVerificationResult.SuccessRehashNeeded)] 156[InlineData(V3_SHA512_250iter_256salt_512subkey, PasswordVerificationResult.SuccessRehashNeeded)] 157[InlineData(V3_SHA512_10000iter_128salt_256subkey, PasswordVerificationResult.SuccessRehashNeeded)] 158[InlineData(V3_SHA512_100000iter_128salt_256subkey, PasswordVerificationResult.Success)] 159public void VerifyHashedPassword_Version3CompatMode_SuccessCases(string hashedPassword, PasswordVerificationResult expectedResult) 165var actualResult = hasher.VerifyHashedPassword(null, hashedPassword, Plaintext_Password);
UserManagerTest.cs (1)
646hasher.Setup(s => s.VerifyHashedPassword(user, hashed, pwd)).Returns(PasswordVerificationResult.SuccessRehashNeeded).Verifiable();
Microsoft.Extensions.Identity.Core (30)
IPasswordHasher.cs (3)
21/// Returns a <see cref="PasswordVerificationResult"/> indicating the result of a password hash comparison. 26/// <returns>A <see cref="PasswordVerificationResult"/> indicating the result of a password hash comparison.</returns> 28PasswordVerificationResult VerifyHashedPassword(TUser user, string hashedPassword, string providedPassword);
PasswordHasher.cs (12)
159/// Returns a <see cref="PasswordVerificationResult"/> indicating the result of a password hash comparison. 164/// <returns>A <see cref="PasswordVerificationResult"/> indicating the result of a password hash comparison.</returns> 166public virtual PasswordVerificationResult VerifyHashedPassword(TUser user, string hashedPassword, string providedPassword) 176return PasswordVerificationResult.Failed; 185? PasswordVerificationResult.SuccessRehashNeeded 186: PasswordVerificationResult.Success; 190return PasswordVerificationResult.Failed; 199return PasswordVerificationResult.SuccessRehashNeeded; 205return PasswordVerificationResult.SuccessRehashNeeded; 208return PasswordVerificationResult.Success; 212return PasswordVerificationResult.Failed; 216return PasswordVerificationResult.Failed; // unknown format marker
UserManager.cs (10)
766if (result == PasswordVerificationResult.Failed) 781private async Task<(PasswordVerificationResult? result, bool userMissing)> CheckPasswordCoreAsync(TUser user, string password) 790var result = await VerifyPasswordAsync(passwordStore, user, password).ConfigureAwait(false); 792if (result == PasswordVerificationResult.SuccessRehashNeeded) 898if (await VerifyPasswordAsync(passwordStore, user, currentPassword).ConfigureAwait(false) != PasswordVerificationResult.Failed) 939/// Returns a <see cref="PasswordVerificationResult"/> indicating the result of a password hash comparison. 945/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="PasswordVerificationResult"/> 948protected virtual async Task<PasswordVerificationResult> VerifyPasswordAsync(IUserPasswordStore<TUser> store, TUser user, string password) 953return PasswordVerificationResult.Failed; 955var result = PasswordHasher.VerifyHashedPassword(user, hash, password);
UserManagerMetrics.cs (5)
127internal void CheckPassword(string userType, bool? userMissing, PasswordVerificationResult? result, Exception? exception = null) 237private static string GetPasswordResult(PasswordVerificationResult? result, bool? passwordMissing, bool? userMissing) 241(PasswordVerificationResult.Success, false, false) => "success", 242(PasswordVerificationResult.SuccessRehashNeeded, false, false) => "success_rehash_needed", 243(PasswordVerificationResult.Failed, false, false) => "failure",