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);
Microsoft.Extensions.Identity.Core (30)
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",