/// <summary> /// Creates a new <see cref="ClaimsIdentity"/> from this instance. /// </summary> /// <param name="manager">The current <see cref="AdminUserManager"/> instance.</param> /// <returns>A new <see cref="ClaimsIdentity"/> instance.</returns> public async Task <ClaimsIdentity> GenerateUserIdentityAsync(AdminUserManager manager, bool isPersistentState, bool screenLockedState) { var identity = await manager.CreateIdentityAsync( this, DefaultAuthenticationTypes.ApplicationCookie ); var claims = AdminPrincipal.GetAdminClaims( adminUserEntity: this, isPersistent: isPersistentState, screenLocked: screenLockedState ); foreach (var claim in claims) { if (!identity.HasClaim(claim.Type, claim.Value)) { identity.AddClaim(claim); } } return(identity); }
/// <summary> /// Constructor method. /// </summary> /// <param name="adminUserManager">The current user manager.</param> /// <param name="authenticationManager">The current authentication manager.</param> public AdminSignInManager(AdminUserManager adminUserManager, IAuthenticationManager authenticationManager) : base(adminUserManager, authenticationManager) { _adminUserManager = adminUserManager; }