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)
186
var
signInResult = success ?
SignInResult
.Success :
SignInResult
.Failed;
400
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
402
public virtual async Task<
SignInResult
> PasswordSignInAsync(TUser user, string password,
410
var
attempt = await CheckPasswordSignInAsync(user, password, lockoutOnFailure);
411
var
result = attempt.Succeeded
433
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
435
public virtual async Task<
SignInResult
> PasswordSignInAsync(string userName, string password,
442
_metrics?.AuthenticateSignIn(typeof(TUser).FullName!, AuthenticationScheme,
SignInResult
.Failed, SignInType.Password, isPersistent, startTimestamp);
443
return
SignInResult
.Failed;
455
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
457
public virtual async Task<
SignInResult
> CheckPasswordSignInAsync(TUser user, string password, bool lockoutOnFailure)
463
var
result = await CheckPasswordSignInCoreAsync(user, password, lockoutOnFailure);
475
private async Task<
SignInResult
> CheckPasswordSignInCoreAsync(TUser user, string password, bool lockoutOnFailure)
477
var
error = await PreSignInCheck(user);
495
return
SignInResult
.Failed;
499
return
SignInResult
.Success;
510
return
SignInResult
.Failed;
518
return
SignInResult
.Failed;
646
/// The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
649
public virtual async Task<
SignInResult
> PasskeySignInAsync([StringSyntax(StringSyntaxAttribute.Json)] string credentialJson)
654
var
result = await PasskeySignInCoreAsync(credentialJson);
666
private async Task<
SignInResult
> PasskeySignInCoreAsync(string credentialJson)
674
return
SignInResult
.Failed;
687
return
SignInResult
.Failed;
690
var
error = await PreSignInCheck(assertionResult.User);
701
return
SignInResult
.Failed;
822
public virtual async Task<
SignInResult
> TwoFactorRecoveryCodeSignInAsync(string recoveryCode)
827
var
result = await TwoFactorRecoveryCodeSignInCoreAsync(recoveryCode);
839
private async Task<
SignInResult
> TwoFactorRecoveryCodeSignInCoreAsync(string recoveryCode)
844
return
SignInResult
.Failed;
854
return
SignInResult
.Failed;
857
private async Task<
SignInResult
> DoTwoFactorSignInAsync(TUser user, TwoFactorAuthenticationInfo twoFactorInfo, bool isPersistent, bool rememberClient)
865
return
SignInResult
.Failed;
892
return
SignInResult
.Success;
902
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
904
public virtual async Task<
SignInResult
> TwoFactorAuthenticatorSignInAsync(string code, bool isPersistent, bool rememberClient)
909
var
result = await TwoFactorAuthenticatorSignInCoreAsync(code, isPersistent, rememberClient);
921
private async Task<
SignInResult
> TwoFactorAuthenticatorSignInCoreAsync(string code, bool isPersistent, bool rememberClient)
926
return
SignInResult
.Failed;
930
var
error = await PreSignInCheck(user);
948
return
SignInResult
.Failed;
956
return
SignInResult
.Failed;
967
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
969
public virtual async Task<
SignInResult
> TwoFactorSignInAsync(string provider, string code, bool isPersistent, bool rememberClient)
974
var
result = await TwoFactorSignInCoreAsync(provider, code, isPersistent, rememberClient);
986
private async Task<
SignInResult
> TwoFactorSignInCoreAsync(string provider, string code, bool isPersistent, bool rememberClient)
991
return
SignInResult
.Failed;
995
var
error = await PreSignInCheck(user);
1012
return
SignInResult
.Failed;
1020
return
SignInResult
.Failed;
1045
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
1047
public virtual Task<
SignInResult
> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent)
1057
/// <returns>The task object representing the asynchronous operation containing the <see cref="
SignInResult
"/>
1059
public virtual async Task<
SignInResult
> ExternalLoginSignInAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1064
var
result = await ExternalLoginSignInCoreAsync(loginProvider, providerKey, isPersistent, bypassTwoFactor);
1076
private async Task<
SignInResult
> ExternalLoginSignInCoreAsync(string loginProvider, string providerKey, bool isPersistent, bool bypassTwoFactor)
1081
return
SignInResult
.Failed;
1084
var
error = await PreSignInCheck(user);
1239
/// <returns>Returns a <see cref="
SignInResult
"/></returns>
1240
protected virtual async Task<
SignInResult
> SignInOrTwoFactorAsync(TUser user, bool isPersistent, string? loginProvider = null, bool bypassTwoFactor = false)
1261
return
SignInResult
.TwoFactorRequired;
1277
return
SignInResult
.Success;
1327
protected virtual Task<
SignInResult
> LockedOut(TUser user)
1330
return Task.FromResult(
SignInResult
.LockedOut);
1338
protected virtual async Task<
SignInResult
?> PreSignInCheck(TUser user)
1342
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>