Show / Hide Table of Contents

Class MixIdentityService

Inheritance
System.Object
MixIdentityService
Implements
IMixIdentityService
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mix.Lib.Services
Assembly: mix.library.dll
Syntax
public class MixIdentityService : IMixIdentityService

Constructors

| Improve this Doc View Source

MixIdentityService(IHttpContextAccessor, TenantUserManager, SignInManager<MixUser>, RoleManager<MixRole>, AuthConfigService, UnitOfWorkInfo<MixCmsContext>, UnitOfWorkInfo<MixCmsAccountContext>, MixCacheService, FirebaseService, MixDataService, MixService)

Declaration
public MixIdentityService(IHttpContextAccessor httpContextAccessor, TenantUserManager userManager, SignInManager<MixUser> signInManager, RoleManager<MixRole> roleManager, AuthConfigService authConfigService, UnitOfWorkInfo<MixCmsContext> cmsUOW, UnitOfWorkInfo<MixCmsAccountContext> accountUOW, MixCacheService cacheService, FirebaseService firebaseService, MixDataService mixDataService, MixService mixService)
Parameters
Type Name Description
Microsoft.AspNetCore.Http.IHttpContextAccessor httpContextAccessor
TenantUserManager userManager
Microsoft.AspNetCore.Identity.SignInManager<MixUser> signInManager
Microsoft.AspNetCore.Identity.RoleManager<MixRole> roleManager
AuthConfigService authConfigService
UnitOfWorkInfo<MixCmsContext> cmsUOW
UnitOfWorkInfo<MixCmsAccountContext> accountUOW
MixCacheService cacheService
FirebaseService firebaseService
MixDataService mixDataService
MixService mixService

Fields

| Improve this Doc View Source

_accountUow

Declaration
protected readonly UnitOfWorkInfo _accountUow
Field Value
Type Description
UnitOfWorkInfo
| Improve this Doc View Source

_authConfigService

Declaration
protected readonly AuthConfigService _authConfigService
Field Value
Type Description
AuthConfigService
| Improve this Doc View Source

_cacheService

Declaration
protected readonly MixCacheService _cacheService
Field Value
Type Description
MixCacheService
| Improve this Doc View Source

_cmsContext

Declaration
protected readonly MixCmsContext _cmsContext
Field Value
Type Description
MixCmsContext
| Improve this Doc View Source

_cmsUow

Declaration
protected readonly UnitOfWorkInfo _cmsUow
Field Value
Type Description
UnitOfWorkInfo
| Improve this Doc View Source

_firebaseService

Declaration
protected readonly FirebaseService _firebaseService
Field Value
Type Description
FirebaseService
| Improve this Doc View Source

_mixDataService

Declaration
protected readonly MixDataService _mixDataService
Field Value
Type Description
MixDataService
| Improve this Doc View Source

_mixService

Declaration
protected readonly MixService _mixService
Field Value
Type Description
MixService
| Improve this Doc View Source

_refreshTokenRepo

Declaration
protected readonly Repository<MixCmsAccountContext, RefreshTokens, Guid, RefreshTokenViewModel> _refreshTokenRepo
Field Value
Type Description
Repository<MixCmsAccountContext, RefreshTokens, Guid, RefreshTokenViewModel>
| Improve this Doc View Source

_roleManager

Declaration
protected readonly RoleManager<MixRole> _roleManager
Field Value
Type Description
Microsoft.AspNetCore.Identity.RoleManager<MixRole>
| Improve this Doc View Source

_roleRepo

Declaration
protected readonly Repository<MixCmsAccountContext, AspNetRoles, Guid, RoleViewModel> _roleRepo
Field Value
Type Description
Repository<MixCmsAccountContext, AspNetRoles, Guid, RoleViewModel>
| Improve this Doc View Source

_signInManager

Declaration
protected readonly SignInManager<MixUser> _signInManager
Field Value
Type Description
Microsoft.AspNetCore.Identity.SignInManager<MixUser>
| Improve this Doc View Source

_userManager

Declaration
protected readonly TenantUserManager _userManager
Field Value
Type Description
TenantUserManager

Properties

| Improve this Doc View Source

MixTenantId

Declaration
protected int MixTenantId { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Roles

Declaration
public List<RoleViewModel> Roles { get; set; }
Property Value
Type Description
List<RoleViewModel>

Methods

| Improve this Doc View Source

CheckEndpointPermission(ClaimsPrincipal, PathString, String)

Declaration
public bool CheckEndpointPermission(ClaimsPrincipal user, PathString path, string method)
Parameters
Type Name Description
System.Security.Claims.ClaimsPrincipal user
Microsoft.AspNetCore.Http.PathString path
System.String method
Returns
Type Description
System.Boolean
| Improve this Doc View Source

CreateClaim(String, String)

Declaration
public Claim CreateClaim(string type, string value)
Parameters
Type Name Description
System.String type
System.String value
Returns
Type Description
System.Security.Claims.Claim
| Improve this Doc View Source

ExternalLogin(RegisterExternalBindingModel)

Declaration
public virtual Task<JObject> ExternalLogin(RegisterExternalBindingModel model)
Parameters
Type Name Description
RegisterExternalBindingModel model
Returns
Type Description
Task<JObject>
| Improve this Doc View Source

GenerateAccessTokenAsync(MixUser, MixUserViewModel, Boolean, String, String)

Declaration
public Task<AccessTokenViewModel> GenerateAccessTokenAsync(MixUser user, MixUserViewModel info, bool isRemember, string aesKey, string rsaPublicKey)
Parameters
Type Name Description
MixUser user
MixUserViewModel info
System.Boolean isRemember
System.String aesKey
System.String rsaPublicKey
Returns
Type Description
Task<AccessTokenViewModel>
| Improve this Doc View Source

GenerateTokenAsync(MixUser, MixUserViewModel, DateTime, String, String, String, MixAuthenticationConfigurations)

Declaration
public Task<string> GenerateTokenAsync(MixUser user, MixUserViewModel info, DateTime expires, string refreshToken, string aesKey, string rsaPublicKey, MixAuthenticationConfigurations appConfigs)
Parameters
Type Name Description
MixUser user
MixUserViewModel info
DateTime expires
System.String refreshToken
System.String aesKey
System.String rsaPublicKey
MixAuthenticationConfigurations appConfigs
Returns
Type Description
Task<System.String>
| Improve this Doc View Source

GetAuthData(MixCmsContext, MixUser, Boolean, Int32)

Declaration
public Task<JObject> GetAuthData(MixCmsContext context, MixUser user, bool rememberMe, int tenantId)
Parameters
Type Name Description
MixCmsContext context
MixUser user
System.Boolean rememberMe
System.Int32 tenantId
Returns
Type Description
Task<JObject>
| Improve this Doc View Source

GetClaim(ClaimsPrincipal, String)

Declaration
public string GetClaim(ClaimsPrincipal User, string claimType)
Parameters
Type Name Description
System.Security.Claims.ClaimsPrincipal User
System.String claimType
Returns
Type Description
System.String
| Improve this Doc View Source

GetClaims(ClaimsPrincipal, String)

Declaration
public static IEnumerable<string> GetClaims(ClaimsPrincipal User, string claimType)
Parameters
Type Name Description
System.Security.Claims.ClaimsPrincipal User
System.String claimType
Returns
Type Description
IEnumerable<System.String>
| Improve this Doc View Source

GetPrincipalFromExpiredToken(String, MixAuthenticationConfigurations)

Declaration
public static ClaimsPrincipal GetPrincipalFromExpiredToken(string token, MixAuthenticationConfigurations appConfigs)
Parameters
Type Name Description
System.String token
MixAuthenticationConfigurations appConfigs
Returns
Type Description
System.Security.Claims.ClaimsPrincipal
| Improve this Doc View Source

GetToken(GetTokenModel)

Declaration
public Task<JObject> GetToken(GetTokenModel model)
Parameters
Type Name Description
GetTokenModel model
Returns
Type Description
Task<JObject>
| Improve this Doc View Source

GetUserAsync(Guid)

Declaration
public Task<MixUserViewModel> GetUserAsync(Guid userId)
Parameters
Type Name Description
Guid userId
Returns
Type Description
Task<MixUserViewModel>
| Improve this Doc View Source

GetValidationParameters(MixAuthenticationConfigurations, Boolean)

Declaration
public static TokenValidationParameters GetValidationParameters(MixAuthenticationConfigurations appConfigs, bool validateLifetime)
Parameters
Type Name Description
MixAuthenticationConfigurations appConfigs
System.Boolean validateLifetime
Returns
Type Description
Microsoft.IdentityModel.Tokens.TokenValidationParameters
| Improve this Doc View Source

Login(LoginViewModel)

Declaration
public Task<JObject> Login(LoginViewModel model)
Parameters
Type Name Description
LoginViewModel model
Returns
Type Description
Task<JObject>
| Improve this Doc View Source

Register(RegisterViewModel, Int32, UnitOfWorkInfo)

Declaration
public Task<JObject> Register(RegisterViewModel model, int tenantId, UnitOfWorkInfo _cmsUOW)
Parameters
Type Name Description
RegisterViewModel model
System.Int32 tenantId
UnitOfWorkInfo _cmsUOW
Returns
Type Description
Task<JObject>
| Improve this Doc View Source

RenewTokenAsync(RenewTokenDto)

Declaration
public Task<JObject> RenewTokenAsync(RenewTokenDto refreshTokenDto)
Parameters
Type Name Description
RenewTokenDto refreshTokenDto
Returns
Type Description
Task<JObject>
| Improve this Doc View Source

VerifyExternalAccessToken(MixExternalLoginProviders, String, MixAuthenticationConfigurations)

Declaration
public Task<ParsedExternalAccessToken> VerifyExternalAccessToken(MixExternalLoginProviders provider, string accessToken, MixAuthenticationConfigurations appConfigs)
Parameters
Type Name Description
MixExternalLoginProviders provider
System.String accessToken
MixAuthenticationConfigurations appConfigs
Returns
Type Description
Task<ParsedExternalAccessToken>

Implements

IMixIdentityService
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾