CDCavell.ClassLibrary.Web.Identity - cdcavell/cdcavell.name Wiki

CDCavell.ClassLibrary.Web.Identity.Authorization.CustomAuthorizeAttribute

CustomAuthorizeAttribute Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.1.0 04/02/2021 Permission-Based Authorization

Methods:

CustomAuthorizeAttribute(string Permissions) : base(typeof(CustomAuthorizeFilter))

CustomAuthorizeAttribute method

Parameters
Permissions string

( Home )

CDCavell.ClassLibrary.Web.Identity.Authorization.CustomAuthorizeFilter

CustomAuthorizeFilter Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.1.0 04/10/2021 Permission-Based Authorization

Methods:

CustomAuthorizeFilter( ILogger logger, IAppSettingsService appSettings, UserManager userManager, List permissions )

Constructor method

Parameters
logger ILogger
appSettings IAppSettingsService
userManager UserManager
permissions List

OnAuthorization(AuthorizationFilterContext context)

OnAuthorization method

Parameters
context AuthorizationFilterContext

( Home )

CDCavell.ClassLibrary.Web.Identity.Extensions.CustomIdentityServerBuilder

CustomIdentityServerBuilder Options Extension

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.0.0 03/25/2021 Integrate ASP.NET Core Identity

Methods:

AddCustomUserStore(this IServiceCollection serviceCollection, Action options)

Add CustomUserStore Options Extention

Parameters
serviceCollection IServiceCollection
options Action

AddCustomRoleStore(this IServiceCollection serviceCollection, Action options)

Add CustomRoleStore Options Extention

Parameters
serviceCollection IServiceCollection
options Action

( Home )

CDCavell.ClassLibrary.Web.Identity.Models.ApplicationRole

Instance of Microsoft IdentityRole Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.0.0 03/23/2021 Integrate ASP.NET Core Identity
Christopher D. Cavell 1.1.1.0 04/09/2021 Permission-Based Authorization
Properties
Id string
RoleClaims ICollection
Role
string
string

( Home )

CDCavell.ClassLibrary.Web.Identity.Models.ApplicationRoleClaim

Instance of Microsoft IdentityRoleClaim Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.1.0 04/05/2021 Permission-Based Authorization
Properties
Role Role
NormalizedClaimType string
NormalizedClaimValue string

( Home )

CDCavell.ClassLibrary.Web.Identity.Models.ApplicationUser

Instance of Microsoft IdentityUser Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.0.0 03/25/2021 Integrate ASP.NET Core Identity
Christopher D. Cavell 1.1.1.0 04/10/2021 Permission-Based Authorization
Christopher D. Cavell 1.1.1.2 06/19/2021 Permission-Based Authorization
Properties
Id string
FirstName string
LastName string
RequestDate DateTime?
ApprovedDate DateTime?
ApprovedById string
ApprovedBy ApplicationUser
RevokedDate DateTime?
RevokedById string
RevokedBy ApplicationUser
Claims ICollection<IdentityUserClaim>
Logins ICollection<IdentityUserLogin>
Tokens ICollection<IdentityUserToken>
RoleClaims ICollection<IdentityUserRole>
FullName string
IsSysAdmin bool
IsActive bool
IsPending bool
IsRevoked bool
Status string
ApplicationRole

Methods:

HasRoleClaim(System.String)

Validate if user has RoleClaim

Parameters
roleClaims string

Returns:

bool

( Home )

CDCavell.ClassLibrary.Web.Identity.Models.ApplicationUserRole

Instance of Microsoft IdentityUserRole Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.1.0 04/06/2021 Permission-Based Authorization
Properties
Role ApplicationRole

( Home )

CDCavell.ClassLibrary.Web.Identity.Models.AspNetUserRoleClaim

Instance of Microsoft IdentityUserRoleClaim Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.1.0 04/11/2021 Permission-Based Authorization
Fields
RoleClaimStatus.Requested 0
RoleClaimStatus.Approved 1
RoleClaimStatus.Retired 2
RoleClaimStatus.Rejected 3
Properties
Id string
UserId string
User ApplicationUser
RoleId string
Role ApplicationRole
RoleClaimId int
RoleClaim ApplicationRoleClaim
Status RoleClaimStatus
History AspNetUserRoleClaimHistory
string
string
UserRoleClaim
DateTime
string
ApplicationUser
RoleClaimStatus

( Home )

CDCavell.ClassLibrary.Web.Identity.Models.AspNetUserRoleClaim.RoleClaimStatus

Fields
Requested 0
Approved 1
Retired 2
Rejected 3

( Home )

CDCavell.ClassLibrary.Web.Identity.Models.AspNetUserRoleClaimHistory

Custom UserRoleClaimHistory Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.1.0 04/09/2021 Permission-Based Authorization
Properties
Id string
UserRoleClaimId string
UserRoleClaim UserRoleClaim
ActionOn DateTime
ActionById string
ActionBy ApplicationUser
Status RoleClaimStatus

( Home )

CDCavell.ClassLibrary.Web.Identity.Services.CustomRoleManager

Custom UserManager Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.1.0 04/11/2021 Permission-Based Authorization
Christopher D. Cavell 1.1.1.4 07/03/2021 Permission-Based Authorization

Methods:

CustomUserManager( IRoleStore store, IEnumerable<IRoleValidator> roleValidators, ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, ILogger logger ) : base(store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger)

Constructor method

Parameters
store IRoleStore
roleValidators IEnumerable<IRoleValidator>
keyNormalizer ILookupNormalizer
errors IdentityErrorDescriber
logger ILogger

GetUsersAsync(string roleId, int roleClaimId)

Custom GetUsersAsync Method

Parameters
roleId string
roleClaimId int

Returns:

Task<List>

GetApprovedUsersAsync(string roleId, int roleClaimId)

Custom GetApprovedUsersAsync Method

Parameters
roleId string
roleClaimId int

Returns:

Task<List>

( Home )

CDCavell.ClassLibrary.Web.Identity.Services.CustomRoleStore

Custom RoleStore Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.0.0 03/23/2021 Integrate ASP.NET Core Identity
Christopher D. Cavell 1.1.1.0 04/11/2021 Permission-Based Authorization
Christopher D. Cavell 1.1.1.2 06/13/2021 Permission-Based Authorization
Christopher D. Cavell 1.1.1.4 07/03/2021 Permission-Based Authorization
Properties
Roles IQueryable
string
string
string

Methods:

CustomRoleStore( ILogger logger, IOptions options, IHttpContextAccessor httpContextAccessor )

Constructor method

Parameters
logger ILogger
options IOptions
httpContextAccessor HttpContextAccessor

CreateAsync(ApplicationRole role, CancellationToken cancellationToken = default(CancellationToken))

Implemented IRoleStore CreateAsync Method

Parameters
role ApplicationRole
cancellationToken CancellationToken

Returns:

Task

DeleteAsync(ApplicationRole role, CancellationToken cancellationToken = default(CancellationToken))

Implemented IRoleStore DeleteAsync Method

Parameters
role ApplicationRole
cancellationToken CancellationToken

Returns:

Task

FindByIdAsync(string roleId, CancellationToken cancellationToken = default(CancellationToken))

Implemented IRoleStore Method

Parameters
roleId string
cancellationToken CancellationToken

Returns:

Task

FindByNameAsync(string normalizedRoleName, CancellationToken cancellationToken = default(CancellationToken))

Implemented IRoleStore FindByNameAsync Method

Parameters
normalizedRoleName string
cancellationToken CancellationToken

Returns:

Task

GetNormalizedRoleNameAsync(ApplicationRole role, CancellationToken cancellationToken = default(CancellationToken))

Implemented IRoleStore GetNormalizedRoleNameAsync Method

Parameters
role ApplicationRole
cancellationToken CancellationToken

Returns:

Task

GetRoleIdAsync(ApplicationRole role, CancellationToken cancellationToken = default(CancellationToken))

Implemented IRoleStore GetRoleIdAsync Method

Parameters
role ApplicationRole
cancellationToken CancellationToken

Returns:

Task

GetRoleNameAsync(ApplicationRole role, CancellationToken cancellationToken = default(CancellationToken))

Implemented IRoleStore GetRoleNameAsync Method

Parameters
role ApplicationRole
cancellationToken CancellationToken

Returns:

Task

SetNormalizedRoleNameAsync(ApplicationRole role, string normalizedName, CancellationToken cancellationToken = default(CancellationToken))

Implemented IRoleStore SetNormalizedRoleNameAsync Method

Parameters
role ApplicationRole
normalizedName string
cancellationToken CancellationToken

Returns:

Task

SetRoleNameAsync(ApplicationRole role, string roleName, CancellationToken cancellationToken = default(CancellationToken))

Implemented IRoleStore SetRoleNameAsync Method

Parameters
role ApplicationRole
roleName string
cancellationToken CancellationToken

Returns:

Task

UpdateAsync(ApplicationRole role, CancellationToken cancellationToken = default(CancellationToken))

Implemented IRoleStore UpdateAsync Method

Parameters
role ApplicationRole
cancellationToken CancellationToken

Returns:

Task

GetUsersAsync(string roleId, int roleClaimId, CancellationToken cancellationToken = default(CancellationToken))

Custom GetUsersAsync Method

Parameters
roleId string
roleClaimId int
cancellationToken CancellationToken

Returns:

Task<List>

GetApprovedUsersAsync(string roleId, int roleClaimId, CancellationToken cancellationToken = default(CancellationToken))

Custom GetApprovedUsersAsync Method

Parameters
roleId string
roleClaimId int
cancellationToken CancellationToken

Returns:

Task<List>

Dispose(bool disposing)

Implemented IRoleStore Dispose Method

Parameters
disposing bool

Dispose()

Implemented IRoleStore Dispose Method

( Home )

CDCavell.ClassLibrary.Web.Identity.Services.CustomRoleStoreOptions

CustomRoleStore Service Options

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.0.0 03/23/2021 Integrate ASP.NET Core Identity
Properties
ISDBaseUrl string
ApiBaseUrl string
ApiAccessToken string

( Home )

CDCavell.ClassLibrary.Web.Identity.Services.CustomUserManager

Custom UserManager Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.0.0 03/25/2021 Integrate ASP.NET Core Identity
Christopher D. Cavell 1.1.1.0 03/30/2021 Permission-Based Authorization
Christopher D. Cavell 1.1.1.2 06/12/2021 Permission-Based Authorization

Methods:

CustomUserManager( IUserStore store, IOptions optionsAccessor, IPasswordHasher passwordHasher, IEnumerable<IUserValidator> userValidators, IEnumerable<IPasswordValidator> passwordValidators, ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, IServiceProvider services, ILogger logger ) : base(store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger)

Constructor method

Parameters
store IUserStore
optionsAccessor IOptions
passwordHasher IPasswordHasher
userValidators IEnumerable<IUserValidator>
passwordValidators IEnumerable<IPasswordValidator>
keyNormalizer ILookupNormalizer
errors IdentityErrorDescriber
services IServiceProvider
logger ILogger

GetPendingRegistrations())

CustomUserStore GetPendingRegistrations Method

Returns:

Task<List>

GetRoleClaimHistory(string userRoleClaimId))

CustomUserStore GetRoleClaimHistory Method

Returns:

Task<List>

( Home )

CDCavell.ClassLibrary.Web.Identity.Services.CustomUserStore

Custom UserStore Class

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.0.0 03/26/2021 Integrate ASP.NET Core Identity
Christopher D. Cavell 1.1.1.0 04/11/2021 Permission-Based Authorization
Christopher D. Cavell 1.1.1.1 06/06/2021 Permission-Based Authorization
Christopher D. Cavell 1.1.1.2 06/13/2021 Permission-Based Authorization
Properties
string
string
string

Methods:

CustomUserStore( ILogger logger, IOptions options, IHttpContextAccessor httpContextAccessor ) : base()

Constructor method

Parameters
logger ILogger
options IOptions
httpContextAccessor HttpContextAccessor

GetRoleClaimHistory(CancellationToken cancellationToken)

Custom GetRoleClaimHistory Method

Parameters
userRoleClaimId string
cancellationToken CancellationToken

Returns:

Task<List>

CreateAsync(CancellationToken cancellationToken)

Custom GetPendingRegistrations Method

Parameters
cancellationToken CancellationToken

Returns:

Task<List>

CreateAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserStore CreateAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task

DeleteAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserStore DeleteAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task

FindByIdAsync(string userId, CancellationToken cancellationToken)

Implemented IUserStore FindByIdAsync Method

Parameters
userId string
cancellationToken CancellationToken

Returns:

Task

FindByNameAsync(string normalizedUserName, CancellationToken cancellationToken)

Implemented IUserStore FindByNameAsync Method

Parameters
normalizedUserName string
cancellationToken CancellationToken

Returns:

Task

GetNormalizedUserNameAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserStore GetNormalizedUserNameAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task

GetUserIdAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserStore GetUserIdAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task

GetUserNameAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserStore GetUserNameAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task

SetNormalizedUserNameAsync(ApplicationUser user, string normalizedName, CancellationToken cancellationToken)

Implemented IUserStore SetNormalizedUserNameAsync Method

Parameters
user ApplicationUser
normalizedName string
cancellationToken CancellationToken

Returns:

Task

SetUserNameAsync(ApplicationUser user, string userName, CancellationToken cancellationToken)

Implemented IUserStore SetUserNameAsync Method

Parameters
user ApplicationUser
userName string
cancellationToken CancellationToken

Returns:

Task

UpdateAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserStore UpdateAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task

AddLoginAsync(ApplicationUser user, UserLoginInfo login, CancellationToken cancellationToken)

Implemented IUserLoginStore AddLoginAsync Method

Parameters
user ApplicationUser
login UserLoginInfo
cancellationToken CancellationToken

Returns:

Task

FindByLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken)

Implemented IUserLoginStore FindByLoginAsync Method

Parameters
loginProvider string
providerKey string
cancellationToken CancellationToken

Returns:

Task

RemoveLoginAsync(ApplicationUser user, string loginProvider, string providerKey, CancellationToken cancellationToken)

Implemented IUserLoginStore RemoveLoginAsync Method

Parameters
user ApplicationUser
loginProvider string
providerKey string
cancellationToken CancellationToken

Returns:

Task

GetLoginsAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserLoginStore GetLoginsAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task<IList>

GetClaimsAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserClaimStore GetClaimsAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task<IList>

AddClaimsAsync(ApplicationUser user, IEnumerable claims, CancellationToken cancellationToken)

Implemented IUserClaimStore AddClaimsAsync Method

Parameters
user ApplicationUser
claims IEnumerable
cancellationToken CancellationToken

Returns:

Task

AddAdditionalClaimsAsync(ApplicationUser user, IEnumerable claims, CancellationToken cancellationToken)

Implemented Custom AddAdditionalClaimsAsync Method

Parameters
user ApplicationUser
claims IEnumerable
cancellationToken CancellationToken

Returns:

Task

ReplaceClaimAsync(ApplicationUser user, Claim claim, Claim newClaim, CancellationToken cancellationToken)

Implemented IUserClaimStore ReplaceClaimAsync Method

Parameters
user ApplicationUser
claim Claim
newClaim Claim
cancellationToken CancellationToken

Returns:

Task

RemoveClaimsAsync(ApplicationUser user, IEnumerable claims, CancellationToken cancellationToken)

Implemented IUserClaimStore RemoveClaimsAsync Method

Parameters
user ApplicationUser
claims IEnumerable
cancellationToken CancellationToken

Returns:

Task

GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken)

Implemented IUserClaimStore GetUsersForClaimAsync Method

Parameters
claim Claim
cancellationToken CancellationToken

Returns:

Task

SetEmailAsync(ApplicationUser user, string email, CancellationToken cancellationToken)

Implemented IUserEmailStore SetEmailAsync Method

Parameters
user ApplicationUser
email string
cancellationToken CancellationToken

Returns:

Task

GetEmailAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserEmailStore GetEmailAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task

GetEmailConfirmedAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserEmailStore GetEmailConfirmedAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task

SetEmailConfirmedAsync(ApplicationUser user, bool confirmed, CancellationToken cancellationToken)

Implemented IUserEmailStore SetEmailConfirmedAsync Method

Parameters
user ApplicationUser
confirmed bool
cancellationToken CancellationToken

Returns:

Task

FindByEmailAsync(string normalizedEmail, CancellationToken cancellationToken)

Implemented IUserEmailStore FindByEmailAsync Method

Parameters
normalizedEmail string
cancellationToken CancellationToken

Returns:

Task

GetNormalizedEmailAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserEmailStore GetNormalizedEmailAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task

SetNormalizedEmailAsync(ApplicationUser user, string normalizedEmail, CancellationToken cancellationToken)

Implemented IUserEmailStore SetNormalizedEmailAsync Method

Parameters
user ApplicationUser
normalizedEmail string
cancellationToken CancellationToken

Returns:

Task

SetTwoFactorEnabledAsync(ApplicationUser user, bool enabled, CancellationToken cancellationToken)

Implemented IUserTwoFactorStore SetTwoFactorEnabledAsync Method

Parameters
user ApplicationUser
enabled bool
cancellationToken CancellationToken

Returns:

Task

GetTwoFactorEnabledAsync(ApplicationUser user, CancellationToken cancellationToken)

Implemented IUserTwoFactorStore GetTwoFactorEnabledAsync Method

Parameters
user ApplicationUser
cancellationToken CancellationToken

Returns:

Task

Dispose(bool disposing)

Implemented IUserStore Dispose Method

Parameters
disposing bool

Dispose()

Implemented IUserStore Dispose Method

( Home )

CDCavell.ClassLibrary.Web.Identity.Services.CustomUserStoreOptions

CustomUserStore Service Options

Revisions:

Contributor Build Revison Date Description
Christopher D. Cavell 1.1.0.0 03/24/2021 Integrate ASP.NET Core Identity
Properties
ISDBaseUrl string
ApiBaseUrl string
ApiAccessToken string

( Home )