mirror of https://github.com/abpframework/abp.git
committed by
GitHub
12 changed files with 115 additions and 39 deletions
@ -0,0 +1,19 @@ |
|||||
|
namespace Volo.Abp.IdentityServer |
||||
|
{ |
||||
|
public class IdentityServerSecurityLogActionConsts |
||||
|
{ |
||||
|
public static string LoginSucceeded { get; set; } = "LoginSucceeded"; |
||||
|
|
||||
|
public static string LoginLockedout { get; set; } = "LoginLockedout"; |
||||
|
|
||||
|
public static string LoginNotAllowed { get; set; } = "LoginNotAllowed"; |
||||
|
|
||||
|
public static string LoginRequiresTwoFactor { get; set; } = "LoginRequiresTwoFactor"; |
||||
|
|
||||
|
public static string LoginFailed { get; set; } = "LoginFailed"; |
||||
|
|
||||
|
public static string LoginInvalidUserName { get; set; } = "LoginInvalidUserName"; |
||||
|
|
||||
|
public static string LoginInvalidUserNameOrPassword { get; set; } = "LoginInvalidUserNameOrPassword"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
namespace Volo.Abp.IdentityServer |
||||
|
{ |
||||
|
public class IdentityServerSecurityLogIdentityConsts |
||||
|
{ |
||||
|
public static string IdentityServer { get; set; } = "IdentityServer"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
using Microsoft.AspNetCore.Identity; |
||||
|
|
||||
|
namespace Volo.Abp.IdentityServer.AspNetIdentity |
||||
|
{ |
||||
|
public static class SignInResultExtensions |
||||
|
{ |
||||
|
public static string ToIdentitySecurityLogAction(this SignInResult result) |
||||
|
{ |
||||
|
if (result.Succeeded) |
||||
|
{ |
||||
|
return IdentityServerSecurityLogActionConsts.LoginSucceeded; |
||||
|
} |
||||
|
|
||||
|
if (result.IsLockedOut) |
||||
|
{ |
||||
|
return IdentityServerSecurityLogActionConsts.LoginLockedout; |
||||
|
} |
||||
|
|
||||
|
if (result.RequiresTwoFactor) |
||||
|
{ |
||||
|
return IdentityServerSecurityLogActionConsts.LoginRequiresTwoFactor; |
||||
|
} |
||||
|
|
||||
|
if (result.IsNotAllowed) |
||||
|
{ |
||||
|
return IdentityServerSecurityLogActionConsts.LoginNotAllowed; |
||||
|
} |
||||
|
|
||||
|
if (!result.Succeeded) |
||||
|
{ |
||||
|
return IdentityServerSecurityLogActionConsts.LoginFailed; |
||||
|
} |
||||
|
|
||||
|
return IdentityServerSecurityLogActionConsts.LoginFailed; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue