mirror of https://github.com/abpframework/abp.git
239 changed files with 10936 additions and 11177 deletions
@ -1,9 +1,8 @@ |
|||||
using Volo.Abp.Application.Dtos; |
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class GetIdentityRolesInput : PagedAndSortedResultRequestDto |
||||
{ |
{ |
||||
public class GetIdentityRolesInput : PagedAndSortedResultRequestDto |
public string Filter { get; set; } |
||||
{ |
|
||||
public string Filter { get; set; } |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
using Volo.Abp.Application.Dtos; |
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class GetIdentityUsersInput : PagedAndSortedResultRequestDto |
||||
{ |
{ |
||||
public class GetIdentityUsersInput : PagedAndSortedResultRequestDto |
public string Filter { get; set; } |
||||
{ |
|
||||
public string Filter { get; set; } |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,37 +1,36 @@ |
|||||
using Volo.Abp.Reflection; |
using Volo.Abp.Reflection; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class IdentityPermissions |
||||
{ |
{ |
||||
public static class IdentityPermissions |
public const string GroupName = "AbpIdentity"; |
||||
{ |
|
||||
public const string GroupName = "AbpIdentity"; |
|
||||
|
|
||||
public static class Roles |
public static class Roles |
||||
{ |
{ |
||||
public const string Default = GroupName + ".Roles"; |
public const string Default = GroupName + ".Roles"; |
||||
public const string Create = Default + ".Create"; |
public const string Create = Default + ".Create"; |
||||
public const string Update = Default + ".Update"; |
public const string Update = Default + ".Update"; |
||||
public const string Delete = Default + ".Delete"; |
public const string Delete = Default + ".Delete"; |
||||
public const string ManagePermissions = Default + ".ManagePermissions"; |
public const string ManagePermissions = Default + ".ManagePermissions"; |
||||
} |
} |
||||
|
|
||||
public static class Users |
public static class Users |
||||
{ |
{ |
||||
public const string Default = GroupName + ".Users"; |
public const string Default = GroupName + ".Users"; |
||||
public const string Create = Default + ".Create"; |
public const string Create = Default + ".Create"; |
||||
public const string Update = Default + ".Update"; |
public const string Update = Default + ".Update"; |
||||
public const string Delete = Default + ".Delete"; |
public const string Delete = Default + ".Delete"; |
||||
public const string ManagePermissions = Default + ".ManagePermissions"; |
public const string ManagePermissions = Default + ".ManagePermissions"; |
||||
} |
} |
||||
|
|
||||
public static class UserLookup |
public static class UserLookup |
||||
{ |
{ |
||||
public const string Default = GroupName + ".UserLookup"; |
public const string Default = GroupName + ".UserLookup"; |
||||
} |
} |
||||
|
|
||||
public static string[] GetAll() |
public static string[] GetAll() |
||||
{ |
{ |
||||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(IdentityPermissions)); |
return ReflectionHelper.GetPublicConstantsRecursively(typeof(IdentityPermissions)); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class IdentityRemoteServiceConsts |
||||
{ |
{ |
||||
public static class IdentityRemoteServiceConsts |
public const string RemoteServiceName = "AbpIdentity"; |
||||
{ |
|
||||
public const string RemoteServiceName = "AbpIdentity"; |
|
||||
|
|
||||
public const string ModuleName = "identity"; |
public const string ModuleName = "identity"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,7 +1,6 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentityRoleCreateDto : IdentityRoleCreateOrUpdateDtoBase |
||||
{ |
{ |
||||
public class IdentityRoleCreateDto : IdentityRoleCreateOrUpdateDtoBase |
|
||||
{ |
|
||||
|
|
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
using Volo.Abp.Domain.Entities; |
using Volo.Abp.Domain.Entities; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentityRoleUpdateDto : IdentityRoleCreateOrUpdateDtoBase, IHasConcurrencyStamp |
||||
{ |
{ |
||||
public class IdentityRoleUpdateDto : IdentityRoleCreateOrUpdateDtoBase, IHasConcurrencyStamp |
public string ConcurrencyStamp { get; set; } |
||||
{ |
} |
||||
public string ConcurrencyStamp { get; set; } |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using System.ComponentModel.DataAnnotations; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentityUserUpdateRolesDto |
||||
{ |
{ |
||||
public class IdentityUserUpdateRolesDto |
[Required] |
||||
{ |
public string[] RoleNames { get; set; } |
||||
[Required] |
} |
||||
public string[] RoleNames { get; set; } |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,7 +1,6 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class UserLookupCountInputDto |
||||
{ |
{ |
||||
public class UserLookupCountInputDto |
public string Filter { get; set; } |
||||
{ |
} |
||||
public string Filter { get; set; } |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
using Volo.Abp.Application.Dtos; |
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class UserLookupSearchInputDto : PagedAndSortedResultRequestDto |
||||
{ |
{ |
||||
public class UserLookupSearchInputDto : PagedAndSortedResultRequestDto |
public string Filter { get; set; } |
||||
{ |
} |
||||
public string Filter { get; set; } |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,16 +1,15 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class AbpIdentityApplicationModuleAutoMapperProfile : Profile |
||||
{ |
{ |
||||
public class AbpIdentityApplicationModuleAutoMapperProfile : Profile |
public AbpIdentityApplicationModuleAutoMapperProfile() |
||||
{ |
{ |
||||
public AbpIdentityApplicationModuleAutoMapperProfile() |
CreateMap<IdentityUser, IdentityUserDto>() |
||||
{ |
.MapExtraProperties(); |
||||
CreateMap<IdentityUser, IdentityUserDto>() |
|
||||
.MapExtraProperties(); |
|
||||
|
|
||||
CreateMap<IdentityRole, IdentityRoleDto>() |
CreateMap<IdentityRole, IdentityRoleDto>() |
||||
.MapExtraProperties(); |
.MapExtraProperties(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
using Volo.Abp.Application.Services; |
using Volo.Abp.Application.Services; |
||||
using Volo.Abp.Identity.Localization; |
using Volo.Abp.Identity.Localization; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public abstract class IdentityAppServiceBase : ApplicationService |
||||
{ |
{ |
||||
public abstract class IdentityAppServiceBase : ApplicationService |
protected IdentityAppServiceBase() |
||||
{ |
{ |
||||
protected IdentityAppServiceBase() |
ObjectMapperContext = typeof(AbpIdentityApplicationModule); |
||||
{ |
LocalizationResource = typeof(IdentityResource); |
||||
ObjectMapperContext = typeof(AbpIdentityApplicationModule); |
|
||||
LocalizationResource = typeof(IdentityResource); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
namespace Volo.Abp.Identity.AspNetCore |
namespace Volo.Abp.Identity.AspNetCore; |
||||
|
|
||||
|
public class AbpIdentityAspNetCoreOptions |
||||
{ |
{ |
||||
public class AbpIdentityAspNetCoreOptions |
/// <summary>
|
||||
{ |
/// Default: true.
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default: true.
|
public bool ConfigureAuthentication { get; set; } = true; |
||||
/// </summary>
|
|
||||
public bool ConfigureAuthentication { get; set; } = true; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,37 +1,36 @@ |
|||||
using Microsoft.AspNetCore.Identity; |
using Microsoft.AspNetCore.Identity; |
||||
|
|
||||
namespace Volo.Abp.Identity.AspNetCore |
namespace Volo.Abp.Identity.AspNetCore; |
||||
|
|
||||
|
public static class SignInResultExtensions |
||||
{ |
{ |
||||
public static class SignInResultExtensions |
public static string ToIdentitySecurityLogAction(this SignInResult result) |
||||
{ |
{ |
||||
public static string ToIdentitySecurityLogAction(this SignInResult result) |
if (result.Succeeded) |
||||
{ |
{ |
||||
if (result.Succeeded) |
return IdentitySecurityLogActionConsts.LoginSucceeded; |
||||
{ |
} |
||||
return IdentitySecurityLogActionConsts.LoginSucceeded; |
|
||||
} |
|
||||
|
|
||||
if (result.IsLockedOut) |
|
||||
{ |
|
||||
return IdentitySecurityLogActionConsts.LoginLockedout; |
|
||||
} |
|
||||
|
|
||||
if (result.RequiresTwoFactor) |
if (result.IsLockedOut) |
||||
{ |
{ |
||||
return IdentitySecurityLogActionConsts.LoginRequiresTwoFactor; |
return IdentitySecurityLogActionConsts.LoginLockedout; |
||||
} |
} |
||||
|
|
||||
if (result.IsNotAllowed) |
if (result.RequiresTwoFactor) |
||||
{ |
{ |
||||
return IdentitySecurityLogActionConsts.LoginNotAllowed; |
return IdentitySecurityLogActionConsts.LoginRequiresTwoFactor; |
||||
} |
} |
||||
|
|
||||
if (!result.Succeeded) |
if (result.IsNotAllowed) |
||||
{ |
{ |
||||
return IdentitySecurityLogActionConsts.LoginFailed; |
return IdentitySecurityLogActionConsts.LoginNotAllowed; |
||||
} |
} |
||||
|
|
||||
|
if (!result.Succeeded) |
||||
|
{ |
||||
return IdentitySecurityLogActionConsts.LoginFailed; |
return IdentitySecurityLogActionConsts.LoginFailed; |
||||
} |
} |
||||
|
|
||||
|
return IdentitySecurityLogActionConsts.LoginFailed; |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,19 +1,18 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
using Volo.Abp.AutoMapper; |
using Volo.Abp.AutoMapper; |
||||
|
|
||||
namespace Volo.Abp.Identity.Blazor |
namespace Volo.Abp.Identity.Blazor; |
||||
|
|
||||
|
public class AbpIdentityBlazorAutoMapperProfile : Profile |
||||
{ |
{ |
||||
public class AbpIdentityBlazorAutoMapperProfile : Profile |
public AbpIdentityBlazorAutoMapperProfile() |
||||
{ |
{ |
||||
public AbpIdentityBlazorAutoMapperProfile() |
CreateMap<IdentityUserDto, IdentityUserUpdateDto>() |
||||
{ |
.MapExtraProperties() |
||||
CreateMap<IdentityUserDto, IdentityUserUpdateDto>() |
.Ignore(x => x.Password) |
||||
.MapExtraProperties() |
.Ignore(x => x.RoleNames); |
||||
.Ignore(x => x.Password) |
|
||||
.Ignore(x => x.RoleNames); |
CreateMap<IdentityRoleDto, IdentityRoleUpdateDto>() |
||||
|
.MapExtraProperties(); |
||||
CreateMap<IdentityRoleDto, IdentityRoleUpdateDto>() |
|
||||
.MapExtraProperties(); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
namespace Volo.Abp.Identity.Blazor |
namespace Volo.Abp.Identity.Blazor; |
||||
|
|
||||
|
public class IdentityMenuNames |
||||
{ |
{ |
||||
public class IdentityMenuNames |
public const string GroupName = "AbpIdentity"; |
||||
{ |
|
||||
public const string GroupName = "AbpIdentity"; |
|
||||
|
|
||||
public const string Roles = GroupName + ".Roles"; |
public const string Roles = GroupName + ".Roles"; |
||||
public const string Users = GroupName + ".Users"; |
public const string Users = GroupName + ".Users"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
using Microsoft.AspNetCore.Components; |
using Microsoft.AspNetCore.Components; |
||||
|
|
||||
namespace Volo.Abp.Identity.Blazor.Pages.Identity |
namespace Volo.Abp.Identity.Blazor.Pages.Identity; |
||||
|
|
||||
|
public partial class RoleNameComponent : ComponentBase |
||||
{ |
{ |
||||
public partial class RoleNameComponent : ComponentBase |
[Parameter] public object Data { get; set; } |
||||
{ |
} |
||||
[Parameter] public object Data { get; set; } |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
using System; |
using System; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public interface IUserRoleFinder |
||||
{ |
{ |
||||
public interface IUserRoleFinder |
Task<string[]> GetRolesAsync(Guid userId); |
||||
{ |
|
||||
Task<string[]> GetRolesAsync(Guid userId); |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,25 +1,24 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentityClaimTypeConsts |
||||
{ |
{ |
||||
public class IdentityClaimTypeConsts |
/// <summary>
|
||||
{ |
/// Default value: 256
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 256
|
public static int MaxNameLength { get; set; } = 256; |
||||
/// </summary>
|
|
||||
public static int MaxNameLength { get; set; } = 256; |
/// <summary>
|
||||
|
/// Default value: 512
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 512
|
public static int MaxRegexLength { get; set; } = 512; |
||||
/// </summary>
|
|
||||
public static int MaxRegexLength { get; set; } = 512; |
/// <summary>
|
||||
|
/// Default value: 128
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 128
|
public static int MaxRegexDescriptionLength { get; set; } = 128; |
||||
/// </summary>
|
|
||||
public static int MaxRegexDescriptionLength { get; set; } = 128; |
/// <summary>
|
||||
|
/// Default value: 256
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 256
|
public static int MaxDescriptionLength { get; set; } = 256; |
||||
/// </summary>
|
|
||||
public static int MaxDescriptionLength { get; set; } = 256; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,24 +1,23 @@ |
|||||
using System; |
using System; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class IdentityClaimTypeEto |
||||
{ |
{ |
||||
[Serializable] |
public Guid Id { get; set; } |
||||
public class IdentityClaimTypeEto |
|
||||
{ |
public string Name { get; set; } |
||||
public Guid Id { get; set; } |
|
||||
|
|
||||
public string Name { get; set; } |
|
||||
|
|
||||
public bool Required { get; set; } |
public bool Required { get; set; } |
||||
|
|
||||
public bool IsStatic { get; set; } |
public bool IsStatic { get; set; } |
||||
|
|
||||
public string Regex { get; set; } |
public string Regex { get; set; } |
||||
|
|
||||
public string RegexDescription { get; set; } |
public string RegexDescription { get; set; } |
||||
|
|
||||
public string Description { get; set; } |
public string Description { get; set; } |
||||
|
|
||||
public IdentityClaimValueType ValueType { get; set; } |
public IdentityClaimValueType ValueType { get; set; } |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public enum IdentityClaimValueType |
||||
{ |
{ |
||||
public enum IdentityClaimValueType |
String, |
||||
{ |
Int, |
||||
String, |
Boolean, |
||||
Int, |
DateTime |
||||
Boolean, |
|
||||
DateTime |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,14 +1,13 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class IdentityErrorCodes |
||||
{ |
{ |
||||
public static class IdentityErrorCodes |
public const string UserSelfDeletion = "Volo.Abp.Identity:010001"; |
||||
{ |
public const string MaxAllowedOuMembership = "Volo.Abp.Identity:010002"; |
||||
public const string UserSelfDeletion = "Volo.Abp.Identity:010001"; |
public const string ExternalUserPasswordChange = "Volo.Abp.Identity:010003"; |
||||
public const string MaxAllowedOuMembership = "Volo.Abp.Identity:010002"; |
public const string DuplicateOrganizationUnitDisplayName = "Volo.Abp.Identity:010004"; |
||||
public const string ExternalUserPasswordChange = "Volo.Abp.Identity:010003"; |
public const string StaticRoleRenaming = "Volo.Abp.Identity:010005"; |
||||
public const string DuplicateOrganizationUnitDisplayName = "Volo.Abp.Identity:010004"; |
public const string StaticRoleDeletion = "Volo.Abp.Identity:010006"; |
||||
public const string StaticRoleRenaming = "Volo.Abp.Identity:010005"; |
public const string UsersCanNotChangeTwoFactor = "Volo.Abp.Identity:010007"; |
||||
public const string StaticRoleDeletion = "Volo.Abp.Identity:010006"; |
public const string CanNotChangeTwoFactor = "Volo.Abp.Identity:010008"; |
||||
public const string UsersCanNotChangeTwoFactor = "Volo.Abp.Identity:010007"; |
|
||||
public const string CanNotChangeTwoFactor = "Volo.Abp.Identity:010008"; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class IdentityRoleClaimConsts |
||||
{ |
{ |
||||
public static class IdentityRoleClaimConsts |
public static int MaxClaimTypeLength { get; set; } = IdentityUserClaimConsts.MaxClaimTypeLength; |
||||
{ |
|
||||
public static int MaxClaimTypeLength { get; set; } = IdentityUserClaimConsts.MaxClaimTypeLength; |
|
||||
|
|
||||
public static int MaxClaimValueLength { get; set; } = IdentityUserClaimConsts.MaxClaimValueLength; |
public static int MaxClaimValueLength { get; set; } = IdentityUserClaimConsts.MaxClaimValueLength; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,15 +1,14 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class IdentityRoleConsts |
||||
{ |
{ |
||||
public static class IdentityRoleConsts |
/// <summary>
|
||||
{ |
/// Default value: 256
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 256
|
public static int MaxNameLength { get; set; } = 256; |
||||
/// </summary>
|
|
||||
public static int MaxNameLength { get; set; } = 256; |
/// <summary>
|
||||
|
/// Default value: 256
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 256
|
public static int MaxNormalizedNameLength { get; set; } = 256; |
||||
/// </summary>
|
|
||||
public static int MaxNormalizedNameLength { get; set; } = 256; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,20 +1,19 @@ |
|||||
using System; |
using System; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class IdentityRoleEto |
||||
{ |
{ |
||||
[Serializable] |
public Guid Id { get; set; } |
||||
public class IdentityRoleEto |
|
||||
{ |
public Guid? TenantId { get; set; } |
||||
public Guid Id { get; set; } |
|
||||
|
public string Name { get; set; } |
||||
|
|
||||
public Guid? TenantId { get; set; } |
public bool IsDefault { get; set; } |
||||
|
|
||||
public string Name { get; set; } |
public bool IsStatic { get; set; } |
||||
|
|
||||
public bool IsDefault { get; set; } |
|
||||
|
|
||||
public bool IsStatic { get; set; } |
public bool IsPublic { get; set; } |
||||
|
} |
||||
public bool IsPublic { get; set; } |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,16 +1,15 @@ |
|||||
using System; |
using System; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class IdentityRoleNameChangedEto |
||||
{ |
{ |
||||
[Serializable] |
public Guid Id { get; set; } |
||||
public class IdentityRoleNameChangedEto |
|
||||
{ |
|
||||
public Guid Id { get; set; } |
|
||||
|
|
||||
public Guid? TenantId { get; set; } |
public Guid? TenantId { get; set; } |
||||
|
|
||||
public string Name { get; set; } |
public string Name { get; set; } |
||||
|
|
||||
public string OldName { get; set; } |
public string OldName { get; set; } |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,33 +1,32 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentitySecurityLogActionConsts |
||||
{ |
{ |
||||
public class IdentitySecurityLogActionConsts |
public static string LoginSucceeded { get; set; } = "LoginSucceeded"; |
||||
{ |
|
||||
public static string LoginSucceeded { get; set; } = "LoginSucceeded"; |
|
||||
|
|
||||
public static string LoginLockedout { get; set; } = "LoginLockedout"; |
public static string LoginLockedout { get; set; } = "LoginLockedout"; |
||||
|
|
||||
public static string LoginNotAllowed { get; set; } = "LoginNotAllowed"; |
public static string LoginNotAllowed { get; set; } = "LoginNotAllowed"; |
||||
|
|
||||
public static string LoginRequiresTwoFactor { get; set; } = "LoginRequiresTwoFactor"; |
public static string LoginRequiresTwoFactor { get; set; } = "LoginRequiresTwoFactor"; |
||||
|
|
||||
public static string LoginFailed { get; set; } = "LoginFailed"; |
public static string LoginFailed { get; set; } = "LoginFailed"; |
||||
|
|
||||
public static string LoginInvalidUserName { get; set; } = "LoginInvalidUserName"; |
public static string LoginInvalidUserName { get; set; } = "LoginInvalidUserName"; |
||||
|
|
||||
public static string LoginInvalidUserNameOrPassword { get; set; } = "LoginInvalidUserNameOrPassword"; |
public static string LoginInvalidUserNameOrPassword { get; set; } = "LoginInvalidUserNameOrPassword"; |
||||
|
|
||||
public static string Logout { get; set; } = "Logout"; |
public static string Logout { get; set; } = "Logout"; |
||||
|
|
||||
public static string ChangeUserName { get; set; } = "ChangeUserName"; |
public static string ChangeUserName { get; set; } = "ChangeUserName"; |
||||
|
|
||||
public static string ChangeEmail { get; set; } = "ChangeEmail"; |
public static string ChangeEmail { get; set; } = "ChangeEmail"; |
||||
|
|
||||
public static string ChangePhoneNumber { get; set; } = "ChangePhoneNumber"; |
public static string ChangePhoneNumber { get; set; } = "ChangePhoneNumber"; |
||||
|
|
||||
public static string ChangePassword { get; set; } = "ChangePassword"; |
public static string ChangePassword { get; set; } = "ChangePassword"; |
||||
|
|
||||
public static string TwoFactorEnabled { get; set; } = "TwoFactorEnabled"; |
public static string TwoFactorEnabled { get; set; } = "TwoFactorEnabled"; |
||||
|
|
||||
public static string TwoFactorDisabled { get; set; } = "TwoFactorDisabled"; |
public static string TwoFactorDisabled { get; set; } = "TwoFactorDisabled"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,52 +1,51 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentitySecurityLogConsts |
||||
{ |
{ |
||||
public class IdentitySecurityLogConsts |
/// <summary>
|
||||
{ |
/// Default value: 96
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 96
|
public static int MaxApplicationNameLength { get; set; } = 96; |
||||
/// </summary>
|
|
||||
public static int MaxApplicationNameLength { get; set; } = 96; |
/// <summary>
|
||||
|
/// Default value: 96
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 96
|
public static int MaxIdentityLength { get; set; } = 96; |
||||
/// </summary>
|
|
||||
public static int MaxIdentityLength { get; set; } = 96; |
/// <summary>
|
||||
|
/// Default value: 96
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 96
|
public static int MaxActionLength { get; set; } = 96; |
||||
/// </summary>
|
|
||||
public static int MaxActionLength { get; set; } = 96; |
|
||||
|
/// <summary>
|
||||
|
/// Default value: 256
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 256
|
public static int MaxUserNameLength { get; set; } = 256; |
||||
/// </summary>
|
|
||||
public static int MaxUserNameLength { get; set; } = 256; |
/// <summary>
|
||||
|
/// Default value: 64
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 64
|
public static int MaxTenantNameLength { get; set; } = 64; |
||||
/// </summary>
|
|
||||
public static int MaxTenantNameLength { get; set; } = 64; |
/// <summary>
|
||||
|
/// Default value: 64
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 64
|
public static int MaxClientIpAddressLength { get; set; } = 64; |
||||
/// </summary>
|
|
||||
public static int MaxClientIpAddressLength { get; set; } = 64; |
/// <summary>
|
||||
|
/// Default value: 64
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 64
|
public static int MaxClientIdLength { get; set; } = 64; |
||||
/// </summary>
|
|
||||
public static int MaxClientIdLength { get; set; } = 64; |
/// <summary>
|
||||
|
/// Default value: 64
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 64
|
public static int MaxCorrelationIdLength { get; set; } = 64; |
||||
/// </summary>
|
|
||||
public static int MaxCorrelationIdLength { get; set; } = 64; |
/// <summary>
|
||||
|
/// Default value: 512
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 512
|
public static int MaxBrowserInfoLength { get; set; } = 512; |
||||
/// </summary>
|
|
||||
public static int MaxBrowserInfoLength { get; set; } = 512; |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class IdentitySecurityLogIdentityConsts |
||||
{ |
{ |
||||
public static class IdentitySecurityLogIdentityConsts |
public static string Identity { get; set; } = "Identity"; |
||||
{ |
|
||||
public static string Identity { get; set; } = "Identity"; |
|
||||
|
|
||||
public static string IdentityExternal { get; set; } = "IdentityExternal"; |
public static string IdentityExternal { get; set; } = "IdentityExternal"; |
||||
|
|
||||
public static string IdentityTwoFactor { get; set; } = "IdentityTwoFactor"; |
public static string IdentityTwoFactor { get; set; } = "IdentityTwoFactor"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,15 +1,14 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class IdentityUserClaimConsts |
||||
{ |
{ |
||||
public static class IdentityUserClaimConsts |
/// <summary>
|
||||
{ |
/// Default value: 256
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 256
|
public static int MaxClaimTypeLength { get; set; } = 256; |
||||
/// </summary>
|
|
||||
public static int MaxClaimTypeLength { get; set; } = 256; |
|
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Default value: 1024
|
/// Default value: 1024
|
||||
/// </summary>
|
/// </summary>
|
||||
public static int MaxClaimValueLength { get; set; } = 1024; |
public static int MaxClaimValueLength { get; set; } = 1024; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,41 +1,40 @@ |
|||||
using Volo.Abp.Users; |
using Volo.Abp.Users; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class IdentityUserConsts |
||||
{ |
{ |
||||
public static class IdentityUserConsts |
public static int MaxUserNameLength { get; set; } = AbpUserConsts.MaxUserNameLength; |
||||
{ |
|
||||
public static int MaxUserNameLength { get; set; } = AbpUserConsts.MaxUserNameLength; |
|
||||
|
|
||||
public static int MaxNameLength { get; set; } = AbpUserConsts.MaxNameLength; |
public static int MaxNameLength { get; set; } = AbpUserConsts.MaxNameLength; |
||||
|
|
||||
public static int MaxSurnameLength { get; set; } = AbpUserConsts.MaxSurnameLength; |
public static int MaxSurnameLength { get; set; } = AbpUserConsts.MaxSurnameLength; |
||||
|
|
||||
public static int MaxNormalizedUserNameLength { get; set; } = MaxUserNameLength; |
public static int MaxNormalizedUserNameLength { get; set; } = MaxUserNameLength; |
||||
|
|
||||
public static int MaxEmailLength { get; set; } = AbpUserConsts.MaxEmailLength; |
public static int MaxEmailLength { get; set; } = AbpUserConsts.MaxEmailLength; |
||||
|
|
||||
public static int MaxNormalizedEmailLength { get; set; } = MaxEmailLength; |
public static int MaxNormalizedEmailLength { get; set; } = MaxEmailLength; |
||||
|
|
||||
public static int MaxPhoneNumberLength { get; set; } = AbpUserConsts.MaxPhoneNumberLength; |
public static int MaxPhoneNumberLength { get; set; } = AbpUserConsts.MaxPhoneNumberLength; |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Default value: 128
|
/// Default value: 128
|
||||
/// </summary>
|
/// </summary>
|
||||
public static int MaxPasswordLength { get; set; } = 128; |
public static int MaxPasswordLength { get; set; } = 128; |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Default value: 256
|
/// Default value: 256
|
||||
/// </summary>
|
/// </summary>
|
||||
public static int MaxPasswordHashLength { get; set; } = 256; |
public static int MaxPasswordHashLength { get; set; } = 256; |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Default value: 256
|
/// Default value: 256
|
||||
/// </summary>
|
/// </summary>
|
||||
public static int MaxSecurityStampLength { get; set; } = 256; |
public static int MaxSecurityStampLength { get; set; } = 256; |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Default value: 16
|
/// Default value: 16
|
||||
/// </summary>
|
/// </summary>
|
||||
public static int MaxLoginProviderLength { get; set; } = 16; |
public static int MaxLoginProviderLength { get; set; } = 16; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,20 +1,19 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class IdentityUserLoginConsts |
||||
{ |
{ |
||||
public static class IdentityUserLoginConsts |
/// <summary>
|
||||
{ |
/// Default value: 64
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 64
|
public static int MaxLoginProviderLength { get; set; } = 64; |
||||
/// </summary>
|
|
||||
public static int MaxLoginProviderLength { get; set; } = 64; |
/// <summary>
|
||||
|
/// Default value: 196
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 196
|
public static int MaxProviderKeyLength { get; set; } = 196; |
||||
/// </summary>
|
|
||||
public static int MaxProviderKeyLength { get; set; } = 196; |
/// <summary>
|
||||
|
/// Default value: 128
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 128
|
public static int MaxProviderDisplayNameLength { get; set; } = 128; |
||||
/// </summary>
|
|
||||
public static int MaxProviderDisplayNameLength { get; set; } = 128; |
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,15 +1,14 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class IdentityUserTokenConsts |
||||
{ |
{ |
||||
public static class IdentityUserTokenConsts |
/// <summary>
|
||||
{ |
/// Default value: 64
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Default value: 64
|
public static int MaxLoginProviderLength { get; set; } = 64; |
||||
/// </summary>
|
|
||||
public static int MaxLoginProviderLength { get; set; } = 64; |
|
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Default value: 128
|
/// Default value: 128
|
||||
/// </summary>
|
/// </summary>
|
||||
public static int MaxNameLength { get; set; } = 128; |
public static int MaxNameLength { get; set; } = 128; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,11 +1,10 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class LinkUserTokenProviderConsts |
||||
{ |
{ |
||||
public static class LinkUserTokenProviderConsts |
public static string LinkUserTokenProviderName { get; set; } = "AbpLinkUser"; |
||||
{ |
|
||||
public static string LinkUserTokenProviderName { get; set; } = "AbpLinkUser"; |
|
||||
|
|
||||
public static string LinkUserTokenPurpose { get; set; } = "AbpLinkUser"; |
public static string LinkUserTokenPurpose { get; set; } = "AbpLinkUser"; |
||||
|
|
||||
public static string LinkUserLoginTokenPurpose { get; set; } = "AbpLinkUserLogin"; |
public static string LinkUserLoginTokenPurpose { get; set; } = "AbpLinkUserLogin"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,10 +1,9 @@ |
|||||
using Volo.Abp.Localization; |
using Volo.Abp.Localization; |
||||
|
|
||||
namespace Volo.Abp.Identity.Localization |
namespace Volo.Abp.Identity.Localization; |
||||
|
|
||||
|
[LocalizationResourceName("AbpIdentity")] |
||||
|
public class IdentityResource |
||||
{ |
{ |
||||
[LocalizationResourceName("AbpIdentity")] |
|
||||
public class IdentityResource |
|
||||
{ |
|
||||
|
|
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,25 +1,24 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class OrganizationUnitConsts |
||||
{ |
{ |
||||
public static class OrganizationUnitConsts |
/// <summary>
|
||||
{ |
/// Maximum length of the DisplayName property.
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Maximum length of the DisplayName property.
|
public static int MaxDisplayNameLength { get; set; } = 128; |
||||
/// </summary>
|
|
||||
public static int MaxDisplayNameLength { get; set; } = 128; |
|
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Maximum depth of an OU hierarchy.
|
/// Maximum depth of an OU hierarchy.
|
||||
/// </summary>
|
/// </summary>
|
||||
public const int MaxDepth = 16; |
public const int MaxDepth = 16; |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Length of a code unit between dots.
|
/// Length of a code unit between dots.
|
||||
/// </summary>
|
/// </summary>
|
||||
public const int CodeUnitLength = 5; |
public const int CodeUnitLength = 5; |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Maximum length of the Code property.
|
/// Maximum length of the Code property.
|
||||
/// </summary>
|
/// </summary>
|
||||
public const int MaxCodeLength = MaxDepth * (CodeUnitLength + 1) - 1; |
public const int MaxCodeLength = MaxDepth * (CodeUnitLength + 1) - 1; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,16 +1,15 @@ |
|||||
using System; |
using System; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
[Serializable] |
||||
|
public class OrganizationUnitEto |
||||
{ |
{ |
||||
[Serializable] |
public Guid Id { get; set; } |
||||
public class OrganizationUnitEto |
|
||||
{ |
|
||||
public Guid Id { get; set; } |
|
||||
|
|
||||
public Guid? TenantId { get; set; } |
public Guid? TenantId { get; set; } |
||||
|
|
||||
public string Code { get; set; } |
public string Code { get; set; } |
||||
|
|
||||
public string DisplayName { get; set; } |
public string DisplayName { get; set; } |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,52 +1,51 @@ |
|||||
namespace Volo.Abp.Identity.Settings |
namespace Volo.Abp.Identity.Settings; |
||||
|
|
||||
|
public static class IdentitySettingNames |
||||
{ |
{ |
||||
public static class IdentitySettingNames |
private const string Prefix = "Abp.Identity"; |
||||
|
|
||||
|
public static class Password |
||||
|
{ |
||||
|
private const string PasswordPrefix = Prefix + ".Password"; |
||||
|
|
||||
|
public const string RequiredLength = PasswordPrefix + ".RequiredLength"; |
||||
|
public const string RequiredUniqueChars = PasswordPrefix + ".RequiredUniqueChars"; |
||||
|
public const string RequireNonAlphanumeric = PasswordPrefix + ".RequireNonAlphanumeric"; |
||||
|
public const string RequireLowercase = PasswordPrefix + ".RequireLowercase"; |
||||
|
public const string RequireUppercase = PasswordPrefix + ".RequireUppercase"; |
||||
|
public const string RequireDigit = PasswordPrefix + ".RequireDigit"; |
||||
|
} |
||||
|
|
||||
|
public static class Lockout |
||||
|
{ |
||||
|
private const string LockoutPrefix = Prefix + ".Lockout"; |
||||
|
|
||||
|
public const string AllowedForNewUsers = LockoutPrefix + ".AllowedForNewUsers"; |
||||
|
public const string LockoutDuration = LockoutPrefix + ".LockoutDuration"; |
||||
|
public const string MaxFailedAccessAttempts = LockoutPrefix + ".MaxFailedAccessAttempts"; |
||||
|
} |
||||
|
|
||||
|
public static class SignIn |
||||
{ |
{ |
||||
private const string Prefix = "Abp.Identity"; |
private const string SignInPrefix = Prefix + ".SignIn"; |
||||
|
|
||||
public static class Password |
public const string RequireConfirmedEmail = SignInPrefix + ".RequireConfirmedEmail"; |
||||
{ |
public const string EnablePhoneNumberConfirmation = SignInPrefix + ".EnablePhoneNumberConfirmation"; |
||||
private const string PasswordPrefix = Prefix + ".Password"; |
public const string RequireConfirmedPhoneNumber = SignInPrefix + ".RequireConfirmedPhoneNumber"; |
||||
|
} |
||||
public const string RequiredLength = PasswordPrefix + ".RequiredLength"; |
|
||||
public const string RequiredUniqueChars = PasswordPrefix + ".RequiredUniqueChars"; |
public static class User |
||||
public const string RequireNonAlphanumeric = PasswordPrefix + ".RequireNonAlphanumeric"; |
{ |
||||
public const string RequireLowercase = PasswordPrefix + ".RequireLowercase"; |
private const string UserPrefix = Prefix + ".User"; |
||||
public const string RequireUppercase = PasswordPrefix + ".RequireUppercase"; |
|
||||
public const string RequireDigit = PasswordPrefix + ".RequireDigit"; |
public const string IsUserNameUpdateEnabled = UserPrefix + ".IsUserNameUpdateEnabled"; |
||||
} |
public const string IsEmailUpdateEnabled = UserPrefix + ".IsEmailUpdateEnabled"; |
||||
|
} |
||||
public static class Lockout |
|
||||
{ |
public static class OrganizationUnit |
||||
private const string LockoutPrefix = Prefix + ".Lockout"; |
{ |
||||
|
private const string OrganizationUnitPrefix = Prefix + ".OrganizationUnit"; |
||||
public const string AllowedForNewUsers = LockoutPrefix + ".AllowedForNewUsers"; |
|
||||
public const string LockoutDuration = LockoutPrefix + ".LockoutDuration"; |
public const string MaxUserMembershipCount = OrganizationUnitPrefix + ".MaxUserMembershipCount"; |
||||
public const string MaxFailedAccessAttempts = LockoutPrefix + ".MaxFailedAccessAttempts"; |
|
||||
} |
|
||||
|
|
||||
public static class SignIn |
|
||||
{ |
|
||||
private const string SignInPrefix = Prefix + ".SignIn"; |
|
||||
|
|
||||
public const string RequireConfirmedEmail = SignInPrefix + ".RequireConfirmedEmail"; |
|
||||
public const string EnablePhoneNumberConfirmation = SignInPrefix + ".EnablePhoneNumberConfirmation"; |
|
||||
public const string RequireConfirmedPhoneNumber = SignInPrefix + ".RequireConfirmedPhoneNumber"; |
|
||||
} |
|
||||
|
|
||||
public static class User |
|
||||
{ |
|
||||
private const string UserPrefix = Prefix + ".User"; |
|
||||
|
|
||||
public const string IsUserNameUpdateEnabled = UserPrefix + ".IsUserNameUpdateEnabled"; |
|
||||
public const string IsEmailUpdateEnabled = UserPrefix + ".IsEmailUpdateEnabled"; |
|
||||
} |
|
||||
|
|
||||
public static class OrganizationUnit |
|
||||
{ |
|
||||
private const string OrganizationUnitPrefix = Prefix + ".OrganizationUnit"; |
|
||||
|
|
||||
public const string MaxUserMembershipCount = OrganizationUnitPrefix + ".MaxUserMembershipCount"; |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,44 +1,43 @@ |
|||||
using System; |
using System; |
||||
using Volo.Abp.ObjectExtending.Modularity; |
using Volo.Abp.ObjectExtending.Modularity; |
||||
|
|
||||
namespace Volo.Abp.ObjectExtending |
namespace Volo.Abp.ObjectExtending; |
||||
|
|
||||
|
public class IdentityModuleExtensionConfiguration : ModuleExtensionConfiguration |
||||
{ |
{ |
||||
public class IdentityModuleExtensionConfiguration : ModuleExtensionConfiguration |
public IdentityModuleExtensionConfiguration ConfigureUser( |
||||
|
Action<EntityExtensionConfiguration> configureAction) |
||||
|
{ |
||||
|
return this.ConfigureEntity( |
||||
|
IdentityModuleExtensionConsts.EntityNames.User, |
||||
|
configureAction |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
public IdentityModuleExtensionConfiguration ConfigureRole( |
||||
|
Action<EntityExtensionConfiguration> configureAction) |
||||
{ |
{ |
||||
public IdentityModuleExtensionConfiguration ConfigureUser( |
return this.ConfigureEntity( |
||||
Action<EntityExtensionConfiguration> configureAction) |
IdentityModuleExtensionConsts.EntityNames.Role, |
||||
{ |
configureAction |
||||
return this.ConfigureEntity( |
); |
||||
IdentityModuleExtensionConsts.EntityNames.User, |
} |
||||
configureAction |
|
||||
); |
|
||||
} |
|
||||
|
|
||||
public IdentityModuleExtensionConfiguration ConfigureRole( |
public IdentityModuleExtensionConfiguration ConfigureClaimType( |
||||
Action<EntityExtensionConfiguration> configureAction) |
Action<EntityExtensionConfiguration> configureAction) |
||||
{ |
{ |
||||
return this.ConfigureEntity( |
return this.ConfigureEntity( |
||||
IdentityModuleExtensionConsts.EntityNames.Role, |
IdentityModuleExtensionConsts.EntityNames.ClaimType, |
||||
configureAction |
configureAction |
||||
); |
); |
||||
} |
} |
||||
|
|
||||
public IdentityModuleExtensionConfiguration ConfigureClaimType( |
public IdentityModuleExtensionConfiguration ConfigureOrganizationUnit( |
||||
Action<EntityExtensionConfiguration> configureAction) |
Action<EntityExtensionConfiguration> configureAction) |
||||
{ |
{ |
||||
return this.ConfigureEntity( |
return this.ConfigureEntity( |
||||
IdentityModuleExtensionConsts.EntityNames.ClaimType, |
IdentityModuleExtensionConsts.EntityNames.OrganizationUnit, |
||||
configureAction |
configureAction |
||||
); |
); |
||||
} |
|
||||
|
|
||||
public IdentityModuleExtensionConfiguration ConfigureOrganizationUnit( |
|
||||
Action<EntityExtensionConfiguration> configureAction) |
|
||||
{ |
|
||||
return this.ConfigureEntity( |
|
||||
IdentityModuleExtensionConsts.EntityNames.OrganizationUnit, |
|
||||
configureAction |
|
||||
); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,18 +1,17 @@ |
|||||
using System; |
using System; |
||||
using Volo.Abp.ObjectExtending.Modularity; |
using Volo.Abp.ObjectExtending.Modularity; |
||||
|
|
||||
namespace Volo.Abp.ObjectExtending |
namespace Volo.Abp.ObjectExtending; |
||||
|
|
||||
|
public static class IdentityModuleExtensionConfigurationDictionaryExtensions |
||||
{ |
{ |
||||
public static class IdentityModuleExtensionConfigurationDictionaryExtensions |
public static ModuleExtensionConfigurationDictionary ConfigureIdentity( |
||||
|
this ModuleExtensionConfigurationDictionary modules, |
||||
|
Action<IdentityModuleExtensionConfiguration> configureAction) |
||||
{ |
{ |
||||
public static ModuleExtensionConfigurationDictionary ConfigureIdentity( |
return modules.ConfigureModule( |
||||
this ModuleExtensionConfigurationDictionary modules, |
IdentityModuleExtensionConsts.ModuleName, |
||||
Action<IdentityModuleExtensionConfiguration> configureAction) |
configureAction |
||||
{ |
); |
||||
return modules.ConfigureModule( |
|
||||
IdentityModuleExtensionConsts.ModuleName, |
|
||||
configureAction |
|
||||
); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,18 +1,17 @@ |
|||||
namespace Volo.Abp.ObjectExtending |
namespace Volo.Abp.ObjectExtending; |
||||
|
|
||||
|
public static class IdentityModuleExtensionConsts |
||||
{ |
{ |
||||
public static class IdentityModuleExtensionConsts |
public const string ModuleName = "Identity"; |
||||
|
|
||||
|
public static class EntityNames |
||||
{ |
{ |
||||
public const string ModuleName = "Identity"; |
public const string User = "User"; |
||||
|
|
||||
public static class EntityNames |
public const string Role = "Role"; |
||||
{ |
|
||||
public const string User = "User"; |
|
||||
|
|
||||
public const string Role = "Role"; |
public const string ClaimType = "ClaimType"; |
||||
|
|
||||
public const string ClaimType = "ClaimType"; |
public const string OrganizationUnit = "OrganizationUnit"; |
||||
|
|
||||
public const string OrganizationUnit = "OrganizationUnit"; |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,13 +1,12 @@ |
|||||
using Volo.Abp.Data; |
using Volo.Abp.Data; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public static class AbpIdentityDbProperties |
||||
{ |
{ |
||||
public static class AbpIdentityDbProperties |
public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; |
||||
{ |
|
||||
public static string DbTablePrefix { get; set; } = AbpCommonDbProperties.DbTablePrefix; |
|
||||
|
|
||||
public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; |
public static string DbSchema { get; set; } = AbpCommonDbProperties.DbSchema; |
||||
|
|
||||
public const string ConnectionStringName = "AbpIdentity"; |
public const string ConnectionStringName = "AbpIdentity"; |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,12 +1,11 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class AbpIdentityOptions |
||||
{ |
{ |
||||
public class AbpIdentityOptions |
public ExternalLoginProviderDictionary ExternalLoginProviders { get; } |
||||
{ |
|
||||
public ExternalLoginProviderDictionary ExternalLoginProviders { get; } |
|
||||
|
|
||||
public AbpIdentityOptions() |
public AbpIdentityOptions() |
||||
{ |
{ |
||||
ExternalLoginProviders = new ExternalLoginProviderDictionary(); |
ExternalLoginProviders = new ExternalLoginProviderDictionary(); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,17 +1,16 @@ |
|||||
using System.Collections.Generic; |
using System.Collections.Generic; |
||||
using JetBrains.Annotations; |
using JetBrains.Annotations; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class ExternalLoginProviderDictionary : Dictionary<string, ExternalLoginProviderInfo> |
||||
{ |
{ |
||||
public class ExternalLoginProviderDictionary : Dictionary<string, ExternalLoginProviderInfo> |
/// <summary>
|
||||
|
/// Adds or replaces a provider.
|
||||
|
/// </summary>
|
||||
|
public void Add<TProvider>([NotNull] string name) |
||||
|
where TProvider : IExternalLoginProvider |
||||
{ |
{ |
||||
/// <summary>
|
this[name] = new ExternalLoginProviderInfo(name, typeof(TProvider)); |
||||
/// Adds or replaces a provider.
|
|
||||
/// </summary>
|
|
||||
public void Add<TProvider>([NotNull] string name) |
|
||||
where TProvider : IExternalLoginProvider |
|
||||
{ |
|
||||
this[name] = new ExternalLoginProviderInfo(name, typeof(TProvider)); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,25 +1,23 @@ |
|||||
using System; |
using System; |
||||
using JetBrains.Annotations; |
using JetBrains.Annotations; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class ExternalLoginProviderInfo |
||||
{ |
{ |
||||
public class ExternalLoginProviderInfo |
public string Name { get; } |
||||
{ |
|
||||
public string Name { get; } |
|
||||
|
|
||||
public Type Type |
public Type Type { |
||||
{ |
get => _type; |
||||
get => _type; |
set => _type = Check.NotNull(value, nameof(value)); |
||||
set => _type = Check.NotNull(value, nameof(value)); |
} |
||||
} |
private Type _type; |
||||
private Type _type; |
|
||||
|
|
||||
public ExternalLoginProviderInfo( |
public ExternalLoginProviderInfo( |
||||
[NotNull] string name, |
[NotNull] string name, |
||||
[NotNull] Type type) |
[NotNull] Type type) |
||||
{ |
{ |
||||
Name = Check.NotNullOrWhiteSpace(name, nameof(name)); |
Name = Check.NotNullOrWhiteSpace(name, nameof(name)); |
||||
Type = Check.AssignableTo<IExternalLoginProvider>(type, nameof(type)); |
Type = Check.AssignableTo<IExternalLoginProvider>(type, nameof(type)); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,36 +1,35 @@ |
|||||
using JetBrains.Annotations; |
using JetBrains.Annotations; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class ExternalLoginUserInfo |
||||
{ |
{ |
||||
public class ExternalLoginUserInfo |
[CanBeNull] |
||||
{ |
public string Name { get; set; } |
||||
[CanBeNull] |
|
||||
public string Name { get; set; } |
|
||||
|
|
||||
[CanBeNull] |
[CanBeNull] |
||||
public string Surname { get; set; } |
public string Surname { get; set; } |
||||
|
|
||||
[CanBeNull] |
[CanBeNull] |
||||
public string PhoneNumber { get; set; } |
public string PhoneNumber { get; set; } |
||||
|
|
||||
[NotNull] |
[NotNull] |
||||
public string Email { get; private set; } |
public string Email { get; private set; } |
||||
|
|
||||
[CanBeNull] |
[CanBeNull] |
||||
public bool? PhoneNumberConfirmed { get; set; } |
public bool? PhoneNumberConfirmed { get; set; } |
||||
|
|
||||
[CanBeNull] |
[CanBeNull] |
||||
public bool? EmailConfirmed { get; set; } |
public bool? EmailConfirmed { get; set; } |
||||
|
|
||||
[CanBeNull] |
[CanBeNull] |
||||
public bool? TwoFactorEnabled { get; set; } |
public bool? TwoFactorEnabled { get; set; } |
||||
|
|
||||
[CanBeNull] |
[CanBeNull] |
||||
public string ProviderKey { get; set; } |
public string ProviderKey { get; set; } |
||||
|
|
||||
public ExternalLoginUserInfo([NotNull] string email) |
public ExternalLoginUserInfo([NotNull] string email) |
||||
{ |
{ |
||||
Email = Check.NotNullOrWhiteSpace(email, nameof(email)); |
Email = Check.NotNullOrWhiteSpace(email, nameof(email)); |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,32 +1,31 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public interface IExternalLoginProvider |
||||
{ |
{ |
||||
public interface IExternalLoginProvider |
/// <summary>
|
||||
{ |
/// Used to try authenticate a user by this source.
|
||||
/// <summary>
|
/// </summary>
|
||||
/// Used to try authenticate a user by this source.
|
/// <param name="userName">User name or email address</param>
|
||||
/// </summary>
|
/// <param name="plainPassword">Plain password of the user</param>
|
||||
/// <param name="userName">User name or email address</param>
|
/// <returns>True, indicates that this used has authenticated by this source</returns>
|
||||
/// <param name="plainPassword">Plain password of the user</param>
|
Task<bool> TryAuthenticateAsync(string userName, string plainPassword); |
||||
/// <returns>True, indicates that this used has authenticated by this source</returns>
|
|
||||
Task<bool> TryAuthenticateAsync(string userName, string plainPassword); |
|
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// This method is called when a user is authenticated by this source but the user does not exists yet.
|
/// This method is called when a user is authenticated by this source but the user does not exists yet.
|
||||
/// So, the source should create the user and fill the properties.
|
/// So, the source should create the user and fill the properties.
|
||||
/// </summary>
|
/// </summary>
|
||||
/// <param name="userName">User name</param>
|
/// <param name="userName">User name</param>
|
||||
/// <param name="providerName">The name of this provider</param>
|
/// <param name="providerName">The name of this provider</param>
|
||||
/// <returns>Newly created user</returns>
|
/// <returns>Newly created user</returns>
|
||||
Task<IdentityUser> CreateUserAsync(string userName, string providerName); |
Task<IdentityUser> CreateUserAsync(string userName, string providerName); |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// This method is called after an existing user is authenticated by this source.
|
/// This method is called after an existing user is authenticated by this source.
|
||||
/// It can be used to update some properties of the user by the source.
|
/// It can be used to update some properties of the user by the source.
|
||||
/// </summary>
|
/// </summary>
|
||||
/// <param name="providerName">The name of this provider</param>
|
/// <param name="providerName">The name of this provider</param>
|
||||
/// <param name="user">The user that can be updated</param>
|
/// <param name="user">The user that can be updated</param>
|
||||
Task UpdateUserAsync(IdentityUser user, string providerName); |
Task UpdateUserAsync(IdentityUser user, string providerName); |
||||
} |
|
||||
} |
} |
||||
|
|||||
@ -1,41 +1,40 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Volo.Abp.Domain.Services; |
using Volo.Abp.Domain.Services; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentityClaimTypeManager : DomainService |
||||
{ |
{ |
||||
public class IdentityClaimTypeManager : DomainService |
protected IIdentityClaimTypeRepository IdentityClaimTypeRepository { get; } |
||||
|
|
||||
|
public IdentityClaimTypeManager(IIdentityClaimTypeRepository identityClaimTypeRepository) |
||||
{ |
{ |
||||
protected IIdentityClaimTypeRepository IdentityClaimTypeRepository { get; } |
IdentityClaimTypeRepository = identityClaimTypeRepository; |
||||
|
} |
||||
|
|
||||
public IdentityClaimTypeManager(IIdentityClaimTypeRepository identityClaimTypeRepository) |
public virtual async Task<IdentityClaimType> CreateAsync(IdentityClaimType claimType) |
||||
|
{ |
||||
|
if (await IdentityClaimTypeRepository.AnyAsync(claimType.Name)) |
||||
{ |
{ |
||||
IdentityClaimTypeRepository = identityClaimTypeRepository; |
throw new AbpException($"Name Exist: {claimType.Name}"); |
||||
} |
} |
||||
|
|
||||
public virtual async Task<IdentityClaimType> CreateAsync(IdentityClaimType claimType) |
return await IdentityClaimTypeRepository.InsertAsync(claimType); |
||||
{ |
} |
||||
if (await IdentityClaimTypeRepository.AnyAsync(claimType.Name)) |
|
||||
{ |
|
||||
throw new AbpException($"Name Exist: {claimType.Name}"); |
|
||||
} |
|
||||
|
|
||||
return await IdentityClaimTypeRepository.InsertAsync(claimType); |
public virtual async Task<IdentityClaimType> UpdateAsync(IdentityClaimType claimType) |
||||
|
{ |
||||
|
if (await IdentityClaimTypeRepository.AnyAsync(claimType.Name, claimType.Id)) |
||||
|
{ |
||||
|
throw new AbpException($"Name Exist: {claimType.Name}"); |
||||
} |
} |
||||
|
|
||||
public virtual async Task<IdentityClaimType> UpdateAsync(IdentityClaimType claimType) |
if (claimType.IsStatic) |
||||
{ |
{ |
||||
if (await IdentityClaimTypeRepository.AnyAsync(claimType.Name, claimType.Id)) |
throw new AbpException($"Can not update a static ClaimType."); |
||||
{ |
|
||||
throw new AbpException($"Name Exist: {claimType.Name}"); |
|
||||
} |
|
||||
|
|
||||
if (claimType.IsStatic) |
|
||||
{ |
|
||||
throw new AbpException($"Can not update a static ClaimType."); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
return await IdentityClaimTypeRepository.UpdateAsync(claimType); |
|
||||
} |
} |
||||
|
|
||||
|
|
||||
|
return await IdentityClaimTypeRepository.UpdateAsync(claimType); |
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,9 +1,8 @@ |
|||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentityDataSeedResult |
||||
{ |
{ |
||||
public class IdentityDataSeedResult |
public bool CreatedAdminUser { get; set; } |
||||
{ |
|
||||
public bool CreatedAdminUser { get; set; } |
|
||||
|
|
||||
public bool CreatedAdminRole { get; set; } |
public bool CreatedAdminRole { get; set; } |
||||
} |
} |
||||
} |
|
||||
|
|||||
@ -1,16 +1,15 @@ |
|||||
using AutoMapper; |
using AutoMapper; |
||||
using Volo.Abp.Users; |
using Volo.Abp.Users; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentityDomainMappingProfile : Profile |
||||
{ |
{ |
||||
public class IdentityDomainMappingProfile : Profile |
public IdentityDomainMappingProfile() |
||||
{ |
{ |
||||
public IdentityDomainMappingProfile() |
CreateMap<IdentityUser, UserEto>(); |
||||
{ |
CreateMap<IdentityClaimType, IdentityClaimTypeEto>(); |
||||
CreateMap<IdentityUser, UserEto>(); |
CreateMap<IdentityRole, IdentityRoleEto>(); |
||||
CreateMap<IdentityClaimType, IdentityClaimTypeEto>(); |
CreateMap<OrganizationUnit, OrganizationUnitEto>(); |
||||
CreateMap<IdentityRole, IdentityRoleEto>(); |
|
||||
CreateMap<OrganizationUnit, OrganizationUnitEto>(); |
|
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,44 +1,43 @@ |
|||||
using System; |
using System; |
||||
using Volo.Abp.Domain.Entities; |
using Volo.Abp.Domain.Entities; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentityLinkUser : BasicAggregateRoot<Guid> |
||||
{ |
{ |
||||
public class IdentityLinkUser : BasicAggregateRoot<Guid> |
public virtual Guid SourceUserId { get; protected set; } |
||||
{ |
|
||||
public virtual Guid SourceUserId { get; protected set; } |
|
||||
|
|
||||
public virtual Guid? SourceTenantId { get; protected set; } |
public virtual Guid? SourceTenantId { get; protected set; } |
||||
|
|
||||
public virtual Guid TargetUserId { get; protected set; } |
public virtual Guid TargetUserId { get; protected set; } |
||||
|
|
||||
public virtual Guid? TargetTenantId { get; protected set; } |
public virtual Guid? TargetTenantId { get; protected set; } |
||||
|
|
||||
/// <summary>
|
/// <summary>
|
||||
/// Initializes a new instance of <see cref="IdentityLinkUser"/>.
|
/// Initializes a new instance of <see cref="IdentityLinkUser"/>.
|
||||
/// </summary>
|
/// </summary>
|
||||
protected IdentityLinkUser() |
protected IdentityLinkUser() |
||||
{ |
{ |
||||
|
|
||||
} |
} |
||||
|
|
||||
public IdentityLinkUser(Guid id, IdentityLinkUserInfo sourceUser, IdentityLinkUserInfo targetUser) |
public IdentityLinkUser(Guid id, IdentityLinkUserInfo sourceUser, IdentityLinkUserInfo targetUser) |
||||
: base(id) |
: base(id) |
||||
{ |
{ |
||||
SourceUserId = sourceUser.UserId; |
SourceUserId = sourceUser.UserId; |
||||
SourceTenantId = sourceUser.TenantId; |
SourceTenantId = sourceUser.TenantId; |
||||
|
|
||||
TargetUserId = targetUser.UserId; |
TargetUserId = targetUser.UserId; |
||||
TargetTenantId = targetUser.TenantId; |
TargetTenantId = targetUser.TenantId; |
||||
} |
} |
||||
|
|
||||
public IdentityLinkUser(Guid id, Guid sourceUserId, Guid? sourceTenantId, Guid targetUserId, Guid? targetTenantId) |
public IdentityLinkUser(Guid id, Guid sourceUserId, Guid? sourceTenantId, Guid targetUserId, Guid? targetTenantId) |
||||
: base(id) |
: base(id) |
||||
{ |
{ |
||||
SourceUserId = sourceUserId; |
SourceUserId = sourceUserId; |
||||
SourceTenantId = sourceTenantId; |
SourceTenantId = sourceTenantId; |
||||
|
|
||||
TargetUserId = targetUserId; |
TargetUserId = targetUserId; |
||||
TargetTenantId = targetTenantId; |
TargetTenantId = targetTenantId; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
@ -1,17 +1,16 @@ |
|||||
using System; |
using System; |
||||
|
|
||||
namespace Volo.Abp.Identity |
namespace Volo.Abp.Identity; |
||||
|
|
||||
|
public class IdentityLinkUserInfo |
||||
{ |
{ |
||||
public class IdentityLinkUserInfo |
public virtual Guid UserId { get; set; } |
||||
{ |
|
||||
public virtual Guid UserId { get; set; } |
|
||||
|
|
||||
public virtual Guid? TenantId { get; set; } |
public virtual Guid? TenantId { get; set; } |
||||
|
|
||||
public IdentityLinkUserInfo(Guid userId, Guid? tenantId) |
public IdentityLinkUserInfo(Guid userId, Guid? tenantId) |
||||
{ |
{ |
||||
UserId = userId; |
UserId = userId; |
||||
TenantId = tenantId; |
TenantId = tenantId; |
||||
} |
|
||||
} |
} |
||||
} |
} |
||||
|
|||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue