5 instantiations of SignInResult
Microsoft.Extensions.Identity.Core (5)
SignInResult.cs (5)
11
private static readonly SignInResult _success = new
SignInResult
{ Succeeded = true };
12
private static readonly SignInResult _failed = new
SignInResult
();
13
private static readonly SignInResult _lockedOut = new
SignInResult
{ IsLockedOut = true };
14
private static readonly SignInResult _notAllowed = new
SignInResult
{ IsNotAllowed = true };
15
private static readonly SignInResult _twoFactorRequired = new
SignInResult
{ RequiresTwoFactor = true };
103 references to SignInResult
Microsoft.AspNetCore.Identity (73)
IdentityApiEndpointRouteBuilderExtensions.cs (1)
99
var
result = await signInManager.PasswordSignInAsync(login.Email, login.Password, isPersistent, lockoutOnFailure: true);
SignInManager.cs (68)
191
var
signInResult = success ?
SignInResult
.Success :
SignInResult
.Failed;
405
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
407
public virtual async Task<
SignInResult
> PasswordSignInAsync(TUser user, string password,
415
var
attempt = await CheckPasswordSignInAsync(user, password, lockoutOnFailure);
416
var
result = attempt.Succeeded
438
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
440
public virtual async Task<
SignInResult
> PasswordSignInAsync(string userName, string password,
447
_metrics?.AuthenticateSignIn(typeof(TUser).FullName!, AuthenticationScheme,
SignInResult
.Failed, SignInType.Password, isPersistent, startTimestamp);
448
return
SignInResult
.Failed;
460
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
462
public virtual async Task<
SignInResult
> CheckPasswordSignInAsync(TUser user, string password, bool lockoutOnFailure)
468
var
result = await CheckPasswordSignInCoreAsync(user, password, lockoutOnFailure);
480
private async Task<
SignInResult
> CheckPasswordSignInCoreAsync(TUser user, string password, bool lockoutOnFailure)
482
var
error = await PreSignInCheck(user);
500
return
SignInResult
.Failed;
504
return
SignInResult
.Success;
515
return
SignInResult
.Failed;
523
return
SignInResult
.Failed;
826
/// The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
829
public virtual async Task<
SignInResult
> PasskeySignInAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
834
var
result = await PasskeySignInCoreAsync(credentialJson);
846
private async Task<
SignInResult
> PasskeySignInCoreAsync(string credentialJson)
854
return
SignInResult
.Failed;
867
return
SignInResult
.Failed;
870
var
error = await PreSignInCheck(assertionResult.User);
881
return
SignInResult
.Failed;
1002
public virtual async Task<
SignInResult
> TwoFactorRecoveryCodeSignInAsync(string recoveryCode)
1007
var
result = await TwoFactorRecoveryCodeSignInCoreAsync(recoveryCode);
1019
private async Task<
SignInResult
> TwoFactorRecoveryCodeSignInCoreAsync(string recoveryCode)
1024
return
SignInResult
.Failed;
1034
return
SignInResult
.Failed;
1037
private async Task<
SignInResult
> DoTwoFactorSignInAsync(TUser user, TwoFactorAuthenticationInfo twoFactorInfo, bool isPersistent, bool rememberClient)
1045
return
SignInResult
.Failed;
1072
return
SignInResult
.Success;
1082
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
1084
public virtual async Task<
SignInResult
> TwoFactorAuthenticatorSignInAsync(string code, bool isPersistent, bool rememberClient)
1089
var
result = await TwoFactorAuthenticatorSignInCoreAsync(code, isPersistent, rememberClient);
1101
private async Task<
SignInResult
> TwoFactorAuthenticatorSignInCoreAsync(string code, bool isPersistent, bool rememberClient)
1106
return
SignInResult
.Failed;
1110
var
error = await PreSignInCheck(user);
1128
return
SignInResult
.Failed;
1136
return
SignInResult
.Failed;
1147
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
1149
public virtual async Task<
SignInResult
> TwoFactorSignInAsync(string provider, string code, bool isPersistent, bool rememberClient)
1154
var
result = await TwoFactorSignInCoreAsync(provider, code, isPersistent, rememberClient);
1166
private async Task<
SignInResult
> TwoFactorSignInCoreAsync(string provider, string code, bool isPersistent, bool rememberClient)
1171
return
SignInResult
.Failed;
1175
var
error = await PreSignInCheck(user);
1192
return
SignInResult
.Failed;
1200
return
SignInResult
.Failed;
1225
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
1227
public virtual Task<
SignInResult
> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent)
1237
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
1239
public virtual async Task<
SignInResult
> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1244
var
result = await ExternalLoginSignInCoreAsync(loginProvider, providerKey, isPersistent, bypassTwoFactor);
1256
private async Task<
SignInResult
> ExternalLoginSignInCoreAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1261
return
SignInResult
.Failed;
1264
var
error = await PreSignInCheck(user);
1425
/// <returns>Returns a <see cref="
SignInResult
"/></returns>
1426
protected virtual async Task<
SignInResult
> SignInOrTwoFactorAsync(TUser user, bool isPersistent, string? loginProvider = null, bool bypassTwoFactor = false)
1446
return
SignInResult
.TwoFactorRequired;
1462
return
SignInResult
.Success;
1508
protected virtual Task<
SignInResult
> LockedOut(TUser user)
1511
return Task.FromResult(
SignInResult
.LockedOut);
1519
protected virtual async Task<
SignInResult
?> PreSignInCheck(TUser user)
1523
return
SignInResult
.NotAllowed;
SignInManagerMetrics.cs (4)
66
internal void CheckPasswordSignIn(string userType,
SignInResult
? result, Exception? exception = null)
83
internal void AuthenticateSignIn(string userType, string authenticationScheme,
SignInResult
? result, SignInType signInType, bool? isPersistent, long startTimestamp, Exception? exception = null)
186
private static void AddSignInResult(ref TagList tags,
SignInResult
? result)
216
private static string GetSignInResult(
SignInResult
result)
Microsoft.AspNetCore.Identity.UI (8)
Areas\Identity\Pages\V4\Account\ExternalLogin.cshtml.cs (1)
141
var
result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false, bypassTwoFactor: true);
Areas\Identity\Pages\V4\Account\Login.cshtml.cs (1)
130
var
result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false);
Areas\Identity\Pages\V4\Account\LoginWith2fa.cshtml.cs (1)
126
var
result = await _signInManager.TwoFactorAuthenticatorSignInAsync(authenticatorCode, rememberMe, Input.RememberMachine);
Areas\Identity\Pages\V4\Account\LoginWithRecoveryCode.cshtml.cs (1)
109
var
result = await _signInManager.TwoFactorRecoveryCodeSignInAsync(recoveryCode);
Areas\Identity\Pages\V5\Account\ExternalLogin.cshtml.cs (1)
141
var
result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false, bypassTwoFactor: true);
Areas\Identity\Pages\V5\Account\Login.cshtml.cs (1)
130
var
result = await _signInManager.PasswordSignInAsync(Input.Email, Input.Password, Input.RememberMe, lockoutOnFailure: false);
Areas\Identity\Pages\V5\Account\LoginWith2fa.cshtml.cs (1)
126
var
result = await _signInManager.TwoFactorAuthenticatorSignInAsync(authenticatorCode, rememberMe, Input.RememberMachine);
Areas\Identity\Pages\V5\Account\LoginWithRecoveryCode.cshtml.cs (1)
109
var
result = await _signInManager.TwoFactorRecoveryCodeSignInAsync(recoveryCode);
Microsoft.Extensions.Identity.Core (22)
SignInResult.cs (22)
11
private static readonly
SignInResult
_success = new SignInResult { Succeeded = true };
12
private static readonly
SignInResult
_failed = new SignInResult();
13
private static readonly
SignInResult
_lockedOut = new SignInResult { IsLockedOut = true };
14
private static readonly
SignInResult
_notAllowed = new SignInResult { IsNotAllowed = true };
15
private static readonly
SignInResult
_twoFactorRequired = new SignInResult { RequiresTwoFactor = true };
42
/// Returns a <see cref="
SignInResult
"/> that represents a successful sign-in.
44
/// <returns>A <see cref="
SignInResult
"/> that represents a successful sign-in.</returns>
45
public static
SignInResult
Success => _success;
48
/// Returns a <see cref="
SignInResult
"/> that represents a failed sign-in.
50
/// <returns>A <see cref="
SignInResult
"/> that represents a failed sign-in.</returns>
51
public static
SignInResult
Failed => _failed;
54
/// Returns a <see cref="
SignInResult
"/> that represents a sign-in attempt that failed because
57
/// <returns>A <see cref="
SignInResult
"/> that represents sign-in attempt that failed due to the
59
public static
SignInResult
LockedOut => _lockedOut;
62
/// Returns a <see cref="
SignInResult
"/> that represents a sign-in attempt that failed because
65
/// <returns>A <see cref="
SignInResult
"/> that represents sign-in attempt that failed due to the
67
public static
SignInResult
NotAllowed => _notAllowed;
70
/// Returns a <see cref="
SignInResult
"/> that represents a sign-in attempt that needs two-factor
73
/// <returns>A <see cref="
SignInResult
"/> that represents sign-in attempt that needs two-factor
75
public static
SignInResult
TwoFactorRequired => _twoFactorRequired;
78
/// Converts the value of the current <see cref="
SignInResult
"/> object to its equivalent string representation.
80
/// <returns>A string representation of value of the current <see cref="
SignInResult
"/> object.</returns>