Class MultitenantUserManager<TUser>
Provides the APIs for managing user in a persistence store.
Inherited Members
Namespace: IRM.AspNetCore.Identity
Assembly: IRM.AspNetCore.Identity.dll
Syntax
public class MultitenantUserManager<TUser> : ExtendedUserManager<TUser>, IDisposable where TUser : class, IMultitenantUser
Type Parameters
TUser
The type encapsulating a user. |
Constructors
MultitenantUserManager(IMultitenantUserStore<TUser>, TenantSettingsManager, IOptions<ExtendedIdentityOptions>, IPasswordHasher<TUser>, IEnumerable<IUserValidator<TUser>>, IEnumerable<IPasswordValidator<TUser>>, ILookupNormalizer, ExtendedIdentityErrorDescriber, IServiceProvider, ILogger<MultitenantUserManager<TUser>>)
Constructs a new instance of MultitenantUserManager<TUser>.
Declaration
public MultitenantUserManager(IMultitenantUserStore<TUser> store, TenantSettingsManager authenticationSettingsManager, IOptions<ExtendedIdentityOptions> optionsAccessor, IPasswordHasher<TUser> passwordHasher, IEnumerable<IUserValidator<TUser>> userValidators, IEnumerable<IPasswordValidator<TUser>> passwordValidators, ILookupNormalizer keyNormalizer, ExtendedIdentityErrorDescriber errorDescriber, IServiceProvider services, ILogger<MultitenantUserManager<TUser>> logger)
Parameters
IMultitenantUserStore<TUser>
store
The persistence store the manager will operate over. |
TenantSettingsManager
authenticationSettingsManager
An instance of TenantSettingsManager used to retrieve tenant authentication settings from. |
Microsoft.Extensions.Options.IOptions<ExtendedIdentityOptions>
optionsAccessor
The accessor used to access the ExtendedIdentityOptions. |
Microsoft.AspNetCore.Identity.IPasswordHasher<TUser>
passwordHasher
The password hashing implementation to use when saving passwords. |
IEnumerable<IUserValidator<TUser>>
userValidators
A collection of IUserValidator<TUser> to validate users against. |
IEnumerable<Microsoft.AspNetCore.Identity.IPasswordValidator<TUser>>
passwordValidators
A collection of Microsoft.AspNetCore.Identity.IPasswordValidator<TUser> to validate passwords against. |
Microsoft.AspNetCore.Identity.ILookupNormalizer
keyNormalizer
The Microsoft.AspNetCore.Identity.ILookupNormalizer to use when generating index keys for users. |
ExtendedIdentityErrorDescriber
errorDescriber
The ExtendedIdentityErrorDescriber used to provider error messages. |
System.IServiceProvider
services
The System.IServiceProvider used to resolve services. |
Microsoft.Extensions.Logging.ILogger<MultitenantUserManager<TUser>>
logger
The logger used to log messages, warnings and errors. |
Properties
MultitenantStore
Gets or sets the persistence store the manager operates over.
Declaration
protected IMultitenantUserStore<TUser> MultitenantStore { get; set; }
Property Value
IMultitenantUserStore<TUser>
The persistence store the manager operates over. |
TenantSettingsManager
Gets the TenantSettingsManager used for managing tenant settings in a persistant store.
Declaration
public TenantSettingsManager TenantSettingsManager { get; }
Property Value
TenantSettingsManager
|
Methods
AddLoginAsync(TUser, UserLoginInfo)
Adds an external Microsoft.AspNetCore.Identity.UserLoginInfo to the specified user
.
Declaration
public override Task<IdentityResult> AddLoginAsync(TUser user, UserLoginInfo login)
Parameters
TUser
user
The user to add the login to. |
Microsoft.AspNetCore.Identity.UserLoginInfo
login
The external Microsoft.AspNetCore.Identity.UserLoginInfo to add to the specified |
Returns
System.Threading.Tasks.Task<IdentityResult>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the IdentityResult of the operation. |
Overrides
FindUsersByEmailAsync(String)
Finds and returns a list of user, if any, who has the specified email address, without filtering on a tenant.
Declaration
public override Task<List<TUser>> FindUsersByEmailAsync(string email)
Parameters
String
email
The email address to search for. |
Returns
System.Threading.Tasks.Task<List<TUser>>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the user matching the specified |
Overrides
FindUsersByLoginAsync(String, String)
Finds and returns a list of users associated with the specified external login provider and login provider key, without filtering on a tenant.
Declaration
public override Task<List<TUser>> FindUsersByLoginAsync(string loginProvider, string providerKey)
Parameters
String
loginProvider
The login provider who provided the |
String
providerKey
The key provided by the |
Returns
System.Threading.Tasks.Task<List<TUser>>
The System.Threading.Tasks.Task for the asynchronous operation, containing the user, if any which matched the specified login provider and key. |
Overrides
FindUsersByNameAsync(String)
Finds and returns a list of user, if any, who has the specified user name, without filtering on a tenant.
Declaration
public override Task<List<TUser>> FindUsersByNameAsync(string userName)
Parameters
String
userName
The user name to search for. |
Returns
System.Threading.Tasks.Task<List<TUser>>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the user matching the specified |
Overrides
SynchronizeRolseAsync(TUser, IEnumerable<String>, IEnumerable<String>)
Adds and removes roles from the user
.
Declaration
protected override async Task<ExternalRoleSynchronizationResult> SynchronizeRolseAsync(TUser user, IEnumerable<string> rolesToAdd, IEnumerable<string> rolesToRemove)
Parameters
TUser
user
The user to synchronize roles for. |
IEnumerable<String>
rolesToAdd
Roles to add to the user. |
IEnumerable<String>
rolesToRemove
Roles to remove from the user. |
Returns
System.Threading.Tasks.Task<ExternalRoleSynchronizationResult>
The System.Threading.Tasks.Task that represents the asynchronous operation, containing the IdentityResult of the operation. |