4 instantiations of IdentityResult
Microsoft.AspNetCore.Identity.Test (1)
IdentityResultTest.cs (1)
11
var result = new
IdentityResult
();
Microsoft.Extensions.Identity.Core (3)
IdentityResult.cs (3)
15
private static readonly IdentityResult _success = new
IdentityResult
{ Succeeded = true };
44
var result = new
IdentityResult
{ Succeeded = false };
54
var result = new
IdentityResult
{ Succeeded = false };
514 references to IdentityResult
Identity.DefaultUI.WebSite (6)
src\Identity\test\InMemory.Test\InMemoryUserStore.cs (6)
221
public Task<
IdentityResult
> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
224
return Task.FromResult(
IdentityResult
.Success);
227
public Task<
IdentityResult
> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
230
return Task.FromResult(
IdentityResult
.Success);
253
public Task<
IdentityResult
> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
260
return Task.FromResult(
IdentityResult
.Success);
Identity.ExternalClaims (11)
Pages\Account\ConfirmEmail.cshtml.cs (1)
37
var
result = await _userManager.ConfirmEmailAsync(user, code);
Pages\Account\ExternalLogin.cshtml.cs (1)
120
var
result = await _userManager.CreateAsync(user);
Pages\Account\Manage\ChangePassword.cshtml.cs (1)
88
var
changePasswordResult = await _userManager.ChangePasswordAsync(user, Input.OldPassword, Input.NewPassword);
Pages\Account\Manage\Disable2fa.cshtml.cs (1)
53
var
disable2faResult = await _userManager.SetTwoFactorEnabledAsync(user, false);
Pages\Account\Manage\ExternalLogins.cshtml.cs (2)
62
var
result = await _userManager.RemoveLoginAsync(user, loginProvider, providerKey);
98
var
result = await _userManager.AddLoginAsync(user, info);
Pages\Account\Manage\Index.cshtml.cs (2)
91
var
setEmailResult = await _userManager.SetEmailAsync(user, Input.Email);
100
var
setPhoneResult = await _userManager.SetPhoneNumberAsync(user, Input.PhoneNumber);
Pages\Account\Manage\SetPassword.cshtml.cs (1)
80
var
addPasswordResult = await _userManager.AddPasswordAsync(user, Input.NewPassword);
Pages\Account\Register.cshtml.cs (1)
72
var
result = await _userManager.CreateAsync(user, Input.Password);
Pages\Account\ResetPassword.cshtml.cs (1)
77
var
result = await _userManager.ResetPasswordAsync(user, Input.Code, Input.Password);
IdentitySample.DefaultUI (3)
Areas\Identity\Pages\Account\Manage\Index.cshtml.cs (2)
92
var
updateProfileResult = await _userManager.UpdateAsync(user);
100
var
setPhoneResult = await _userManager.SetPhoneNumberAsync(user, Input.PhoneNumber);
Areas\Identity\Pages\Account\Register.cshtml.cs (1)
90
var
result = await _userManager.CreateAsync(user, Input.Password);
IdentitySample.Mvc (12)
Controllers\AccountController.cs (5)
107
var
result = await _userManager.CreateAsync(user, model.Password);
212
var
result = await _userManager.CreateAsync(user);
248
var
result = await _userManager.ConfirmEmailAsync(user, code);
325
var
result = await _userManager.ResetPasswordAsync(user, model.Code, model.Password);
537
private void AddErrors(
IdentityResult
result)
Controllers\ManageController.cs (7)
73
var
result = await _userManager.RemoveLoginAsync(user, account.LoginProvider, account.ProviderKey);
193
var
result = await _userManager.ChangePhoneNumberAsync(user, model.PhoneNumber, model.Code);
214
var
result = await _userManager.SetPhoneNumberAsync(user, null);
245
var
result = await _userManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword);
280
var
result = await _userManager.AddPasswordAsync(user, model.NewPassword);
344
var
result = await _userManager.AddLoginAsync(user, info);
351
private void AddErrors(
IdentityResult
result)
IdentitySample.PasskeyConformance (8)
InMemoryUserStore.cs (6)
19
public Task<
IdentityResult
> CreateAsync(TUser user, CancellationToken cancellationToken)
22
return Task.FromResult(
IdentityResult
.Success);
25
public Task<
IdentityResult
> DeleteAsync(TUser user, CancellationToken cancellationToken)
31
return Task.FromResult(
IdentityResult
.Success);
67
public Task<
IdentityResult
> UpdateAsync(TUser user, CancellationToken cancellationToken)
70
return Task.FromResult(
IdentityResult
.Success);
Program.cs (2)
120
var
createUserResult = await userManager.CreateAsync(user);
128
var
updateResult = await userManager.UpdateAsync(user).ConfigureAwait(false);
IdentitySample.PasskeyUI (6)
InMemoryUserStore.cs (6)
19
public Task<
IdentityResult
> CreateAsync(TUser user, CancellationToken cancellationToken)
22
return Task.FromResult(
IdentityResult
.Success);
25
public Task<
IdentityResult
> DeleteAsync(TUser user, CancellationToken cancellationToken)
31
return Task.FromResult(
IdentityResult
.Success);
67
public Task<
IdentityResult
> UpdateAsync(TUser user, CancellationToken cancellationToken)
70
return Task.FromResult(
IdentityResult
.Success);
Microsoft.AspNetCore.Identity (35)
IdentityApiEndpointRouteBuilderExtensions.cs (9)
73
return CreateValidationProblem(
IdentityResult
.Failed(userManager.ErrorDescriber.InvalidEmail(email)));
79
var
result = await userManager.CreateAsync(user, registration.Password);
161
IdentityResult
result;
236
return CreateValidationProblem(
IdentityResult
.Failed(userManager.ErrorDescriber.InvalidToken()));
239
IdentityResult
result;
247
result =
IdentityResult
.Failed(userManager.ErrorDescriber.InvalidToken());
359
return CreateValidationProblem(
IdentityResult
.Failed(userManager.ErrorDescriber.InvalidEmail(infoRequest.NewEmail)));
370
var
changePasswordResult = await userManager.ChangePasswordAsync(user, infoRequest.OldPassword, infoRequest.NewPassword);
429
private static ValidationProblem CreateValidationProblem(
IdentityResult
result)
SignInManager.cs (26)
476
var
resetLockoutResult = await ResetLockoutWithResult(user);
493
var
incrementLockoutResult = await UserManager.AccessFailedAsync(user) ??
IdentityResult
.Success;
664
var
setPasskeyResult = await UserManager.AddOrUpdatePasskeyAsync(assertionResult.User, assertionResult.Passkey);
812
var
result = await UserManager.RedeemTwoFactorRecoveryCodeAsync(twoFactorInfo.User, recoveryCode);
824
var
resetLockoutResult = await ResetLockoutWithResult(user);
907
var
incrementLockoutResult = await UserManager.AccessFailedAsync(user) ??
IdentityResult
.Success;
970
var
incrementLockoutResult = await UserManager.AccessFailedAsync(user) ??
IdentityResult
.Success;
1107
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the operation.</returns>
1108
public virtual async Task<
IdentityResult
> UpdateExternalAuthenticationTokensAsync(ExternalLoginInfo externalLogin)
1117
return
IdentityResult
.Failed();
1122
var
result = await UserManager.SetAuthenticationTokenAsync(user, externalLogin.LoginProvider, token.Name, token.Value);
1130
return
IdentityResult
.Success;
1317
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the operation.</returns>
1323
var
result = await UserManager.ResetAccessFailedCountAsync(user) ??
IdentityResult
.Success;
1332
private async Task<
IdentityResult
> ResetLockoutWithResult(TUser user)
1339
return
IdentityResult
.Success;
1342
return await UserManager.ResetAccessFailedCountAsync(user) ??
IdentityResult
.Success;
1349
if (resetLockoutTask is Task<
IdentityResult
> resultTask)
1351
return await resultTask ??
IdentityResult
.Success;
1355
return
IdentityResult
.Success;
1365
internal IdentityResultException(
IdentityResult
result) : base()
1370
internal
IdentityResult
IdentityResult { get; set; }
Microsoft.AspNetCore.Identity.EntityFrameworkCore (33)
RoleStore.cs (11)
129
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous query.</returns>
130
public virtual async Task<
IdentityResult
> CreateAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
137
return
IdentityResult
.Success;
145
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous query.</returns>
146
public virtual async Task<
IdentityResult
> UpdateAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
160
return
IdentityResult
.Failed(ErrorDescriber.ConcurrencyFailure());
162
return
IdentityResult
.Success;
170
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous query.</returns>
171
public virtual async Task<
IdentityResult
> DeleteAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
183
return
IdentityResult
.Failed(ErrorDescriber.ConcurrencyFailure());
185
return
IdentityResult
.Success;
UserOnlyStore.cs (11)
191
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the creation operation.</returns>
192
public override async Task<
IdentityResult
> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
199
return
IdentityResult
.Success;
207
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the update operation.</returns>
208
public override async Task<
IdentityResult
> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
223
return
IdentityResult
.Failed(ErrorDescriber.ConcurrencyFailure());
225
return
IdentityResult
.Success;
233
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the update operation.</returns>
234
public override async Task<
IdentityResult
> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
247
return
IdentityResult
.Failed(ErrorDescriber.ConcurrencyFailure());
249
return
IdentityResult
.Success;
UserStore.cs (11)
195
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the creation operation.</returns>
196
public override async Task<
IdentityResult
> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
203
return
IdentityResult
.Success;
211
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the update operation.</returns>
212
public override async Task<
IdentityResult
> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
227
return
IdentityResult
.Failed(ErrorDescriber.ConcurrencyFailure());
229
return
IdentityResult
.Success;
237
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the update operation.</returns>
238
public override async Task<
IdentityResult
> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
251
return
IdentityResult
.Failed(ErrorDescriber.ConcurrencyFailure());
253
return
IdentityResult
.Success;
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (2)
SqlStoreTestBase.cs (1)
315
var
result = await manager.CreateAsync(user);
src\Identity\test\Shared\MockHelpers.cs (1)
73
.Returns(Task.FromResult(
IdentityResult
.Success)).Verifiable();
Microsoft.AspNetCore.Identity.InMemory.Test (16)
FunctionalTest.cs (3)
313
var
result = await userManager.CreateAsync(user, TestPassword);
326
var
result = await userManager.CreateAsync(new PocoUser("simple"), "aaaaaa");
332
var
result = await userManager.UpdateSecurityStampAsync(user);
InMemoryStore.cs (6)
72
public Task<
IdentityResult
> CreateAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
75
return Task.FromResult(
IdentityResult
.Success);
78
public Task<
IdentityResult
> DeleteAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
85
return Task.FromResult(
IdentityResult
.Success);
104
public Task<
IdentityResult
> UpdateAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken))
107
return Task.FromResult(
IdentityResult
.Success);
InMemoryUserStore.cs (6)
221
public Task<
IdentityResult
> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
224
return Task.FromResult(
IdentityResult
.Success);
227
public Task<
IdentityResult
> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
230
return Task.FromResult(
IdentityResult
.Success);
253
public Task<
IdentityResult
> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken))
260
return Task.FromResult(
IdentityResult
.Success);
src\Identity\test\Shared\MockHelpers.cs (1)
73
.Returns(Task.FromResult(
IdentityResult
.Success)).Verifiable();
Microsoft.AspNetCore.Identity.Specification.Tests (25)
IdentityResultAssert.cs (4)
19
public static void IsSuccess(
IdentityResult
result)
28
public static void IsFailure(
IdentityResult
result)
37
public static void IsFailure(
IdentityResult
result, string error)
47
public static void IsFailure(
IdentityResult
result, IdentityError error = null)
IdentitySpecificationTestBase.cs (8)
143
public Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user, string password)
145
return Task.FromResult(
IdentityResult
.Failed(ErrorMessage));
148
public Task<
IdentityResult
> ValidateAsync(RoleManager<TRole> manager, TRole role)
150
return Task.FromResult(
IdentityResult
.Failed(ErrorMessage));
153
public Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user)
155
return Task.FromResult(
IdentityResult
.Failed(ErrorMessage));
187
var
result = await manager.CreateAsync(role);
486
var
result = await userMgr.RemoveFromRoleAsync(user, roleName);
UserManagerSpecificationTests.cs (13)
145
public Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user, string password)
147
return Task.FromResult(
IdentityResult
.Failed(ErrorMessage));
150
public Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user)
152
return Task.FromResult(
IdentityResult
.Failed(ErrorMessage));
159
public Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user, string password)
161
return Task.FromResult(
IdentityResult
.Failed());
164
public Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user)
166
return Task.FromResult(
IdentityResult
.Failed());
392
var
result = await manager.CreateAsync(user);
458
var
result = await manager.AddPasswordAsync(user, "pwd");
637
var
result = await manager.CreateAsync(user);
827
var
result = await manager.ChangePasswordAsync(user, "bogus", "newpassword");
904
var
result = await manager.AddLoginAsync(user, login);
Microsoft.AspNetCore.Identity.Test (111)
IdentityBuilderTest.cs (9)
273
public Task<
IdentityResult
> CreateAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
278
public Task<
IdentityResult
> CreateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
283
public Task<
IdentityResult
> DeleteAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
288
public Task<
IdentityResult
> DeleteAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
358
public Task<
IdentityResult
> UpdateAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
363
public Task<
IdentityResult
> UpdateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
368
public Task<
IdentityResult
> ValidateAsync(RoleManager<PocoRole> manager, PocoRole role)
373
public Task<
IdentityResult
> ValidateAsync(UserManager<PocoUser> manager, PocoUser user)
378
public Task<
IdentityResult
> ValidateAsync(UserManager<PocoUser> manager, PocoUser user, string password)
IdentityResultTest.cs (3)
11
var
result = new IdentityResult();
19
var
result =
IdentityResult
.Failed();
NoopRoleStore.cs (6)
8
public Task<
IdentityResult
> CreateAsync(PocoRole user, CancellationToken cancellationToken = default(CancellationToken))
10
return Task.FromResult(
IdentityResult
.Success);
13
public Task<
IdentityResult
> UpdateAsync(PocoRole user, CancellationToken cancellationToken = default(CancellationToken))
15
return Task.FromResult(
IdentityResult
.Success);
42
public Task<
IdentityResult
> DeleteAsync(PocoRole user, CancellationToken cancellationToken = default(CancellationToken))
44
return Task.FromResult(
IdentityResult
.Success);
NoopUserStore.cs (6)
23
public Task<
IdentityResult
> CreateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
25
return Task.FromResult(
IdentityResult
.Success);
28
public Task<
IdentityResult
> UpdateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
30
return Task.FromResult(
IdentityResult
.Success);
47
public Task<
IdentityResult
> DeleteAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
49
return Task.FromResult(
IdentityResult
.Success);
PasswordValidatorTest.cs (1)
168
var
result = await valid.ValidateAsync(manager, null, input);
RoleManagerTest.cs (7)
17
store.Setup(s => s.CreateAsync(role, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
23
var
result = await roleManager.CreateAsync(role);
37
store.Setup(s => s.UpdateAsync(role, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
43
var
result = await roleManager.UpdateAsync(role);
153
public Task<
IdentityResult
> CreateAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
158
public Task<
IdentityResult
> UpdateAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
163
public Task<
IdentityResult
> DeleteAsync(PocoRole role, CancellationToken cancellationToken = default(CancellationToken))
RoleValidatorTest.cs (1)
32
var
result = await validator.ValidateAsync(manager, user);
SignInManagerTest.cs (19)
220
manager.Setup(m => m.ResetAccessFailedCountAsync(user)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
269
manager.Setup(m => m.ResetAccessFailedCountAsync(user)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
292
manager.Setup(m => m.ResetAccessFailedCountAsync(user)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
452
.Returns(Task.FromResult(
IdentityResult
.Success))
549
manager.Setup(m => m.ResetAccessFailedCountAsync(user)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
626
return Task.FromResult(
IdentityResult
.Success);
706
manager.Setup(m => m.RedeemTwoFactorRecoveryCodeAsync(user, bypassCode)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
709
manager.Setup(m => m.ResetAccessFailedCountAsync(user)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
960
manager.Setup(m => m.ResetAccessFailedCountAsync(user)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
1019
return Task.FromResult(
IdentityResult
.Success);
1271
return Task.FromResult(
IdentityResult
.Success);
1298
return Task.FromResult(
IdentityResult
.Success);
1531
manager.Setup(m => m.ResetAccessFailedCountAsync(user)).ReturnsAsync(
IdentityResult
.Failed()).Verifiable();
1554
manager.Setup(m => m.ResetAccessFailedCountAsync(user)).ReturnsAsync((
IdentityResult
)null).Verifiable();
1582
manager.Setup(m => m.ResetAccessFailedCountAsync(user)).ReturnsAsync(
IdentityResult
.Failed()).Verifiable();
1602
new object[] {
IdentityResult
.Success, SignInResult.LockedOut },
1604
new object[] {
IdentityResult
.Failed(), SignInResult.Failed },
1609
public async Task CheckPasswordSignInLockedOutResultIsDependentOnTheAccessFailedAsyncResult(
IdentityResult
accessFailedResult, SignInResult expectedSignInResult)
1635
public async Task TwoFactorSignInLockedOutResultIsDependentOnTheAccessFailedAsyncResult(
IdentityResult
accessFailedResult, SignInResult expectedSignInResult)
src\Identity\test\Shared\MockHelpers.cs (1)
73
.Returns(Task.FromResult(
IdentityResult
.Success)).Verifiable();
UserManagerTest.cs (55)
72
store.Setup(s => s.CreateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
78
var
result = await userManager.CreateAsync(user);
91
store.Setup(s => s.CreateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
97
var
result = await userManager.CreateAsync(user);
111
store.Setup(s => s.CreateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
119
var
result = await userManager.CreateAsync(user);
135
store.Setup(s => s.DeleteAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
139
var
result = await userManager.DeleteAsync(user);
162
store.Setup(s => s.DeleteAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Failed(new IdentityErrorDescriber().ConcurrencyFailure())).Verifiable();
166
var
result = await userManager.DeleteAsync(user);
190
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
194
var
result = await userManager.UpdateAsync(user);
212
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
216
var
result = await userManager.UpdateAsync(user);
233
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).Returns(Task.FromResult(
IdentityResult
.Success)).Verifiable();
237
var
result = await userManager.SetUserNameAsync(user, "foo");
393
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
406
var
result = await userManager.AddToRolesAsync(user, roles);
431
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
445
var
result = await userManager.AddToRolesAsync(user, roles);
470
var
result = await userManager.AddToRolesAsync(user, roles);
494
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
507
var
result = await userManager.RemoveFromRolesAsync(user, roles);
534
var
result = await userManager.RemoveFromRolesAsync(user, roles);
551
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
555
var
result = await userManager.AddClaimsAsync(user, claims);
575
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
579
var
result = await userManager.AddClaimAsync(user, claim);
607
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).Returns(Task.FromResult(
IdentityResult
.Success)).Verifiable();
611
var
result = await userManager.ReplaceClaimAsync(user, claim, newClaim);
644
store.Setup(x => x.UpdateAsync(It.IsAny<PocoUser>(), It.IsAny<CancellationToken>())).Returns(Task.FromResult(
IdentityResult
.Success));
738
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
742
var
result = await userManager.RemoveClaimsAsync(user, claims);
769
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
773
var
result = await userManager.RemoveClaimAsync(user, claim);
795
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
799
var
result = await userManager.AddOrUpdatePasskeyAsync(user, passkey);
851
store.Setup(s => s.UpdateAsync(user, CancellationToken.None)).ReturnsAsync(
IdentityResult
.Success).Verifiable();
855
var
result = await userManager.RemovePasskeyAsync(user, credentialId);
1159
public Task<
IdentityResult
> CreateAsync(PocoUser user, CancellationToken cancellationToken)
1164
public Task<
IdentityResult
> DeleteAsync(PocoUser user, CancellationToken cancellationToken)
1209
public Task<
IdentityResult
> UpdateAsync(PocoUser user, CancellationToken cancellationToken)
1537
private
IdentityResult
badResult;
1543
badResult =
IdentityResult
.Failed(ErrorMessage);
1547
badResult =
IdentityResult
.Failed();
1551
public Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user, string password)
1676
public Task<
IdentityResult
> CreateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1678
return Task.FromResult(
IdentityResult
.Success);
1681
public Task<
IdentityResult
> UpdateAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1683
return Task.FromResult(
IdentityResult
.Success);
1686
public Task<
IdentityResult
> DeleteAsync(PocoUser user, CancellationToken cancellationToken = default(CancellationToken))
1688
return Task.FromResult(
IdentityResult
.Success);
2088
Task<
IdentityResult
> IUserStore<PocoUser>.CreateAsync(PocoUser user, CancellationToken cancellationToken)
2093
Task<
IdentityResult
> IUserStore<PocoUser>.UpdateAsync(PocoUser user, CancellationToken cancellationToken)
2098
Task<
IdentityResult
> IUserStore<PocoUser>.DeleteAsync(PocoUser user, CancellationToken cancellationToken)
UserValidatorTest.cs (3)
32
var
result = await validator.ValidateAsync(manager, user);
54
var
result = await validator.ValidateAsync(manager, user);
82
var
result = await validator.ValidateAsync(manager, user);
Microsoft.AspNetCore.Identity.UI (26)
Areas\Identity\Pages\V4\Account\ConfirmEmail.cshtml.cs (1)
57
var
result = await _userManager.ConfirmEmailAsync(user, code);
Areas\Identity\Pages\V4\Account\ConfirmEmailChange.cshtml.cs (2)
59
var
result = await _userManager.ChangeEmailAsync(user, email, code);
68
var
setUserNameResult = await _userManager.SetUserNameAsync(user, email);
Areas\Identity\Pages\V4\Account\ExternalLogin.cshtml.cs (1)
188
var
result = await _userManager.CreateAsync(user);
Areas\Identity\Pages\V4\Account\Manage\ChangePassword.cshtml.cs (1)
126
var
changePasswordResult = await _userManager.ChangePasswordAsync(user, Input.OldPassword, Input.NewPassword);
Areas\Identity\Pages\V4\Account\Manage\DeletePersonalData.cshtml.cs (1)
105
var
result = await _userManager.DeleteAsync(user);
Areas\Identity\Pages\V4\Account\Manage\Disable2fa.cshtml.cs (1)
74
var
disable2faResult = await _userManager.SetTwoFactorEnabledAsync(user, false);
Areas\Identity\Pages\V4\Account\Manage\ExternalLogins.cshtml.cs (2)
115
var
result = await _userManager.RemoveLoginAsync(user, loginProvider, providerKey);
153
var
result = await _userManager.AddLoginAsync(user, info);
Areas\Identity\Pages\V4\Account\Manage\Index.cshtml.cs (1)
120
var
setPhoneResult = await _userManager.SetPhoneNumberAsync(user, Input.PhoneNumber);
Areas\Identity\Pages\V4\Account\Manage\SetPassword.cshtml.cs (1)
114
var
addPasswordResult = await _userManager.AddPasswordAsync(user, Input.NewPassword);
Areas\Identity\Pages\V4\Account\Register.cshtml.cs (1)
133
var
result = await _userManager.CreateAsync(user, Input.Password);
Areas\Identity\Pages\V4\Account\ResetPassword.cshtml.cs (1)
120
var
result = await _userManager.ResetPasswordAsync(user, Input.Code, Input.Password);
Areas\Identity\Pages\V5\Account\ConfirmEmail.cshtml.cs (1)
57
var
result = await _userManager.ConfirmEmailAsync(user, code);
Areas\Identity\Pages\V5\Account\ConfirmEmailChange.cshtml.cs (2)
59
var
result = await _userManager.ChangeEmailAsync(user, email, code);
68
var
setUserNameResult = await _userManager.SetUserNameAsync(user, email);
Areas\Identity\Pages\V5\Account\ExternalLogin.cshtml.cs (1)
188
var
result = await _userManager.CreateAsync(user);
Areas\Identity\Pages\V5\Account\Manage\ChangePassword.cshtml.cs (1)
126
var
changePasswordResult = await _userManager.ChangePasswordAsync(user, Input.OldPassword, Input.NewPassword);
Areas\Identity\Pages\V5\Account\Manage\DeletePersonalData.cshtml.cs (1)
105
var
result = await _userManager.DeleteAsync(user);
Areas\Identity\Pages\V5\Account\Manage\Disable2fa.cshtml.cs (1)
74
var
disable2faResult = await _userManager.SetTwoFactorEnabledAsync(user, false);
Areas\Identity\Pages\V5\Account\Manage\ExternalLogins.cshtml.cs (2)
115
var
result = await _userManager.RemoveLoginAsync(user, loginProvider, providerKey);
153
var
result = await _userManager.AddLoginAsync(user, info);
Areas\Identity\Pages\V5\Account\Manage\Index.cshtml.cs (1)
120
var
setPhoneResult = await _userManager.SetPhoneNumberAsync(user, Input.PhoneNumber);
Areas\Identity\Pages\V5\Account\Manage\SetPassword.cshtml.cs (1)
114
var
addPasswordResult = await _userManager.AddPasswordAsync(user, Input.NewPassword);
Areas\Identity\Pages\V5\Account\Register.cshtml.cs (1)
133
var
result = await _userManager.CreateAsync(user, Input.Password);
Areas\Identity\Pages\V5\Account\ResetPassword.cshtml.cs (1)
120
var
result = await _userManager.ResetPasswordAsync(user, Input.Code, Input.Password);
Microsoft.Extensions.Identity.Core (208)
DefaultUserConfirmation.cs (1)
19
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the confirmation operation.</returns>
IdentityResult.cs (12)
15
private static readonly
IdentityResult
_success = new IdentityResult { Succeeded = true };
32
/// Returns an <see cref="
IdentityResult
"/> indicating a successful identity operation.
34
/// <returns>An <see cref="
IdentityResult
"/> indicating a successful operation.</returns>
35
public static
IdentityResult
Success => _success;
38
/// Creates an <see cref="
IdentityResult
"/> indicating a failed identity operation, with a list of <paramref name="errors"/> if applicable.
41
/// <returns>An <see cref="
IdentityResult
"/> indicating a failed identity operation, with a list of <paramref name="errors"/> if applicable.</returns>
42
public static
IdentityResult
Failed(params IdentityError[] errors)
44
var
result = new IdentityResult { Succeeded = false };
52
internal static
IdentityResult
Failed(List<IdentityError>? errors)
54
var
result = new IdentityResult { Succeeded = false };
63
/// Converts the value of the current <see cref="
IdentityResult
"/> object to its equivalent string representation.
65
/// <returns>A string representation of the current <see cref="
IdentityResult
"/> object.</returns>
IPasswordValidator.cs (1)
21
Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user, string? password);
IRoleStore.cs (6)
21
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous query.</returns>
22
Task<
IdentityResult
> CreateAsync(TRole role, CancellationToken cancellationToken);
29
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous query.</returns>
30
Task<
IdentityResult
> UpdateAsync(TRole role, CancellationToken cancellationToken);
37
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous query.</returns>
38
Task<
IdentityResult
> DeleteAsync(TRole role, CancellationToken cancellationToken);
IRoleValidator.cs (2)
19
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous validation.</returns>
20
Task<
IdentityResult
> ValidateAsync(RoleManager<TRole> manager, TRole role);
IUserStore.cs (6)
63
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the creation operation.</returns>
64
Task<
IdentityResult
> CreateAsync(TUser user, CancellationToken cancellationToken);
71
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the update operation.</returns>
72
Task<
IdentityResult
> UpdateAsync(TUser user, CancellationToken cancellationToken);
79
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the delete operation.</returns>
80
Task<
IdentityResult
> DeleteAsync(TUser user, CancellationToken cancellationToken);
IUserValidator.cs (2)
19
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the validation operation.</returns>
20
Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user);
PasswordValidator.cs (3)
40
public virtual Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user, string? password)
78
?
IdentityResult
.Failed(errors)
79
:
IdentityResult
.Success);
RoleManager.cs (21)
155
public virtual async Task<
IdentityResult
> CreateAsync(TRole role)
159
var
result = await ValidateRoleAsync(role).ConfigureAwait(false);
187
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> for the update.
189
public virtual Task<
IdentityResult
> UpdateAsync(TRole role)
202
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> for the delete.
204
public virtual Task<
IdentityResult
> DeleteAsync(TRole role)
272
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
275
public virtual async Task<
IdentityResult
> SetRoleNameAsync(TRole role, string? name)
281
return
IdentityResult
.Success;
320
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
323
public virtual async Task<
IdentityResult
> AddClaimAsync(TRole role, Claim claim)
340
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
343
public virtual async Task<
IdentityResult
> RemoveClaimAsync(TRole role, Claim claim)
392
/// Should return <see cref="
IdentityResult
.Success"/> if validation is successful. This is
396
/// <returns>A <see cref="
IdentityResult
"/> representing whether validation was successful.</returns>
397
protected virtual async Task<
IdentityResult
> ValidateRoleAsync(TRole role)
402
var
result = await v.ValidateAsync(this, role).ConfigureAwait(false);
415
return
IdentityResult
.Failed(errors);
417
return
IdentityResult
.Success;
425
protected virtual async Task<
IdentityResult
> UpdateRoleAsync(TRole role)
427
var
result = await ValidateRoleAsync(role).ConfigureAwait(false);
RoleValidator.cs (4)
33
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous validation.</returns>
34
public virtual async Task<
IdentityResult
> ValidateAsync(RoleManager<TRole> manager, TRole role)
41
return
IdentityResult
.Failed(errors);
43
return
IdentityResult
.Success;
UserManager.cs (141)
479
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
482
public virtual async Task<
IdentityResult
> CreateAsync(TUser user)
486
var
result = await CreateCoreAsync(user).ConfigureAwait(false);
497
private async Task<
IdentityResult
> CreateCoreAsync(TUser user)
501
var
validateUserResult = await ValidateUserAsync(user).ConfigureAwait(false);
521
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
524
public virtual async Task<
IdentityResult
> UpdateAsync(TUser user)
545
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
548
public virtual async Task<
IdentityResult
> DeleteAsync(TUser user)
555
var
result = await Store.DeleteAsync(user, CancellationToken).ConfigureAwait(false);
623
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
626
public virtual async Task<
IdentityResult
> CreateAsync(TUser user, string password)
634
var
result = await UpdatePasswordHash(passwordStore, user, password).ConfigureAwait(false);
711
public virtual async Task<
IdentityResult
> SetUserNameAsync(TUser user, string? userName)
815
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
818
public virtual async Task<
IdentityResult
> AddPasswordAsync(TUser user, string password)
822
var
result = await AddPasswordCoreAsync(user, password).ConfigureAwait(false);
833
private async Task<
IdentityResult
> AddPasswordCoreAsync(TUser user, string password)
843
return
IdentityResult
.Failed(ErrorDescriber.UserAlreadyHasPassword());
845
var
result = await UpdatePasswordHash(passwordStore, user, password).ConfigureAwait(false);
861
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
864
public virtual async Task<
IdentityResult
> ChangePasswordAsync(TUser user, string currentPassword, string newPassword)
868
var
result = await ChangePasswordCoreAsync(user, currentPassword, newPassword).ConfigureAwait(false);
879
private async Task<
IdentityResult
> ChangePasswordCoreAsync(TUser user, string currentPassword, string newPassword)
887
var
updateResult = await UpdatePasswordHash(passwordStore, user, newPassword).ConfigureAwait(false);
895
return
IdentityResult
.Failed(ErrorDescriber.PasswordMismatch());
903
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
906
public virtual async Task<
IdentityResult
> RemovePasswordAsync(TUser user)
970
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
976
public virtual async Task<
IdentityResult
> UpdateSecurityStampAsync(TUser user)
1015
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1018
public virtual async Task<
IdentityResult
> ResetPasswordAsync(TUser user, string token, string newPassword)
1026
var
failureResult =
IdentityResult
.Failed(ErrorDescriber.InvalidToken());
1031
var
result = await UpdatePasswordHash(user, newPassword, validatePassword: true).ConfigureAwait(false);
1065
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1068
public virtual async Task<
IdentityResult
> RemoveLoginAsync(TUser user, string loginProvider, string providerKey)
1095
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1098
public virtual async Task<
IdentityResult
> AddLoginAsync(TUser user, UserLoginInfo login)
1102
var
result = await AddLoginCoreAsync(user, login).ConfigureAwait(false);
1113
private async Task<
IdentityResult
> AddLoginCoreAsync(TUser user, UserLoginInfo login)
1124
return
IdentityResult
.Failed(ErrorDescriber.LoginAlreadyAssociated());
1151
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1154
public virtual Task<
IdentityResult
> AddClaimAsync(TUser user, Claim claim)
1165
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1168
public virtual async Task<
IdentityResult
> AddClaimsAsync(TUser user, IEnumerable<Claim> claims)
1194
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1197
public virtual async Task<
IdentityResult
> ReplaceClaimAsync(TUser user, Claim claim, Claim newClaim)
1223
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1226
public virtual Task<
IdentityResult
> RemoveClaimAsync(TUser user, Claim claim)
1237
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1240
public virtual async Task<
IdentityResult
> RemoveClaimsAsync(TUser user, IEnumerable<Claim> claims)
1280
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1283
public virtual async Task<
IdentityResult
> AddToRoleAsync(TUser user, string role)
1287
var
result = await AddToRoleCoreAsync(user, role).ConfigureAwait(false);
1298
private async Task<
IdentityResult
> AddToRoleCoreAsync(TUser user, string role)
1319
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1322
public virtual async Task<
IdentityResult
> AddToRolesAsync(TUser user, IEnumerable<string> roles)
1326
var
result = await AddToRolesCoreAsync(user, roles).ConfigureAwait(false);
1337
private async Task<
IdentityResult
> AddToRolesCoreAsync(TUser user, IEnumerable<string> roles)
1362
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1365
public virtual async Task<
IdentityResult
> RemoveFromRoleAsync(TUser user, string role)
1374
var
failureResult = UserNotInRoleError(role);
1383
private
IdentityResult
UserAlreadyInRoleError(string role)
1389
return
IdentityResult
.Failed(ErrorDescriber.UserAlreadyInRole(role));
1392
private
IdentityResult
UserNotInRoleError(string role)
1398
return
IdentityResult
.Failed(ErrorDescriber.UserNotInRole(role));
1407
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1410
public virtual async Task<
IdentityResult
> RemoveFromRolesAsync(TUser user, IEnumerable<string> roles)
1414
var
result = await RemoveFromRolesCoreAsync(user, roles).ConfigureAwait(false);
1425
private async Task<
IdentityResult
> RemoveFromRolesCoreAsync(TUser user, IEnumerable<string> roles)
1493
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1496
public virtual async Task<
IdentityResult
> SetEmailAsync(TUser user, string? email)
1589
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1592
public virtual async Task<
IdentityResult
> ConfirmEmailAsync(TUser user, string token)
1596
var
result = await ConfirmEmailCoreAsync(user, token).ConfigureAwait(false);
1607
private async Task<
IdentityResult
> ConfirmEmailCoreAsync(TUser user, string token)
1615
return
IdentityResult
.Failed(ErrorDescriber.InvalidToken());
1659
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1662
public virtual async Task<
IdentityResult
> ChangeEmailAsync(TUser user, string newEmail, string token)
1666
var
result = await ChangeEmailCoreAsync(user, newEmail, token).ConfigureAwait(false);
1677
private async Task<
IdentityResult
> ChangeEmailCoreAsync(TUser user, string newEmail, string token)
1685
return
IdentityResult
.Failed(ErrorDescriber.InvalidToken());
1713
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1716
public virtual async Task<
IdentityResult
> SetPhoneNumberAsync(TUser user, string? phoneNumber)
1744
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
1747
public virtual async Task<
IdentityResult
> ChangePhoneNumberAsync(TUser user, string phoneNumber, string token)
1751
var
result = await ChangePhoneNumberCoreAsync(user, phoneNumber, token).ConfigureAwait(false);
1762
private async Task<
IdentityResult
> ChangePhoneNumberCoreAsync(TUser user, string phoneNumber, string token)
1771
return
IdentityResult
.Failed(ErrorDescriber.InvalidToken());
2030
/// The <see cref="Task"/> that represents the asynchronous operation, the <see cref="
IdentityResult
"/> of the operation
2032
public virtual async Task<
IdentityResult
> SetTwoFactorEnabledAsync(TUser user, bool enabled)
2080
/// The <see cref="Task"/> that represents the asynchronous operation, the <see cref="
IdentityResult
"/> of the operation
2082
public virtual async Task<
IdentityResult
> SetLockoutEnabledAsync(TUser user, bool enabled)
2136
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the operation.</returns>
2137
public virtual async Task<
IdentityResult
> SetLockoutEndDateAsync(TUser user, DateTimeOffset? lockoutEnd)
2141
var
result = await SetLockoutEndDateCoreAsync(user, lockoutEnd).ConfigureAwait(false);
2152
private async Task<
IdentityResult
> SetLockoutEndDateCoreAsync(TUser user, DateTimeOffset? lockoutEnd)
2161
return
IdentityResult
.Failed(ErrorDescriber.UserLockoutNotEnabled());
2173
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the operation.</returns>
2174
public virtual async Task<
IdentityResult
> AccessFailedAsync(TUser user)
2205
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the operation.</returns>
2206
public virtual async Task<
IdentityResult
> ResetAccessFailedCountAsync(TUser user)
2210
var
result = await ResetAccessFailedCountCoreAsync(user).ConfigureAwait(false);
2221
private async Task<
IdentityResult
> ResetAccessFailedCountCoreAsync(TUser user)
2229
return
IdentityResult
.Success;
2308
public virtual async Task<
IdentityResult
> SetAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName, string? tokenValue)
2336
public virtual async Task<
IdentityResult
> RemoveAuthenticationTokenAsync(TUser user, string loginProvider, string tokenName)
2374
public virtual async Task<
IdentityResult
> ResetAuthenticatorKeyAsync(TUser user)
2412
var
update = await UpdateUserAndRecordMetricAsync(user, UserUpdateType.GenerateNewTwoFactorRecoveryCodes).ConfigureAwait(false);
2509
public virtual async Task<
IdentityResult
> RedeemTwoFactorRecoveryCodeAsync(TUser user, string code)
2513
var
result = await RedeemTwoFactorRecoveryCodeCoreAsync(user, code).ConfigureAwait(false);
2524
private async Task<
IdentityResult
> RedeemTwoFactorRecoveryCodeCoreAsync(TUser user, string code)
2535
return
IdentityResult
.Failed(ErrorDescriber.RecoveryCodeRedemptionFailed());
2558
public virtual async Task<
IdentityResult
> AddOrUpdatePasskeyAsync(TUser user, UserPasskeyInfo passkey)
2562
var
result = await AddOrUpdatePasskeyCoreAsync(user, passkey).ConfigureAwait(false);
2573
private async Task<
IdentityResult
> AddOrUpdatePasskeyCoreAsync(TUser user, UserPasskeyInfo passkey)
2640
/// The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/>
2643
public virtual async Task<
IdentityResult
> RemovePasskeyAsync(TUser user, byte[] credentialId)
2647
var
result = await RemovePasskeyCoreAsync(user, credentialId).ConfigureAwait(false);
2658
private async Task<
IdentityResult
> RemovePasskeyCoreAsync(TUser user, byte[] credentialId)
2752
protected virtual Task<
IdentityResult
> UpdatePasswordHash(TUser user, string newPassword, bool validatePassword)
2755
private async Task<
IdentityResult
> UpdatePasswordHash(IUserPasswordStore<TUser> passwordStore,
2760
var
validate = await ValidatePasswordAsync(user, newPassword).ConfigureAwait(false);
2769
return
IdentityResult
.Success;
2832
/// Should return <see cref="
IdentityResult
.Success"/> if validation is successful. This is
2836
/// <returns>A <see cref="
IdentityResult
"/> representing whether validation was successful.</returns>
2837
protected async Task<
IdentityResult
> ValidateUserAsync(TUser user)
2852
var
result = await v.ValidateAsync(this, user).ConfigureAwait(false);
2865
return
IdentityResult
.Failed(errors);
2867
return
IdentityResult
.Success;
2871
/// Should return <see cref="
IdentityResult
.Success"/> if validation is successful. This is
2876
/// <returns>A <see cref="
IdentityResult
"/> representing whether validation was successful.</returns>
2877
protected async Task<
IdentityResult
> ValidatePasswordAsync(TUser user, string? password)
2883
var
result = await v.ValidateAsync(this, user, password).ConfigureAwait(false);
2901
return
IdentityResult
.Failed(errors);
2903
return
IdentityResult
.Success;
2911
protected virtual async Task<
IdentityResult
> UpdateUserAsync(TUser user)
2915
var
result = await ValidateUserAsync(user).ConfigureAwait(false);
2925
private async Task<
IdentityResult
> UpdateUserAndRecordMetricAsync(TUser user, UserUpdateType updateType)
2927
var
result = await UpdateUserAsync(user).ConfigureAwait(false);
UserManagerMetrics.cs (5)
43
internal void CreateUser(string userType,
IdentityResult
? result, Exception? exception = null)
60
internal void UpdateUser(string userType,
IdentityResult
? result, UserUpdateType updateType, Exception? exception = null)
78
internal void DeleteUser(string userType,
IdentityResult
? result, Exception? exception = null)
177
private static void AddIdentityResultTags(ref TagList tags,
IdentityResult
? result)
191
private static void AddErrorTag(ref TagList tags, Exception? exception,
IdentityResult
? result = null)
UserValidator.cs (4)
39
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the validation operation.</returns>
40
public virtual async Task<
IdentityResult
> ValidateAsync(UserManager<TUser> manager, TUser user)
49
return errors?.Count > 0 ?
IdentityResult
.Failed(errors) :
IdentityResult
.Success;
Microsoft.Extensions.Identity.Stores (12)
RoleStoreBase.cs (6)
54
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous query.</returns>
55
public abstract Task<
IdentityResult
> CreateAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken));
62
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous query.</returns>
63
public abstract Task<
IdentityResult
> UpdateAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken));
70
/// <returns>A <see cref="Task{TResult}"/> that represents the <see cref="
IdentityResult
"/> of the asynchronous query.</returns>
71
public abstract Task<
IdentityResult
> DeleteAsync(TRole role, CancellationToken cancellationToken = default(CancellationToken));
UserStoreBase.cs (6)
189
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the creation operation.</returns>
190
public abstract Task<
IdentityResult
> CreateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken));
197
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the update operation.</returns>
198
public abstract Task<
IdentityResult
> UpdateAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken));
205
/// <returns>The <see cref="Task"/> that represents the asynchronous operation, containing the <see cref="
IdentityResult
"/> of the update operation.</returns>
206
public abstract Task<
IdentityResult
> DeleteAsync(TUser user, CancellationToken cancellationToken = default(CancellationToken));