View Source
Class BackOfficeUserStore
The user store for back office users
Inheritance
System.Object
Assembly: Umbraco.Infrastructure.dll
Syntax
public class BackOfficeUserStore : UmbracoUserStore<BackOfficeIdentityUser, IdentityRole<string>>, IUserSessionStore<BackOfficeIdentityUser>, IBackOfficeUserStore
Constructors
View Source
BackOfficeUserStore(ICoreScopeProvider, IEntityService, IExternalLoginWithKeyService, IOptionsSnapshot<GlobalSettings>, IUmbracoMapper, BackOfficeErrorDescriber, AppCaches, ITwoFactorLoginService, IUserGroupService, IUserRepository, IRuntimeState, IEventMessagesFactory, ILogger<BackOfficeUserStore>)
Declaration
public BackOfficeUserStore(ICoreScopeProvider scopeProvider, IEntityService entityService, IExternalLoginWithKeyService externalLoginService, IOptionsSnapshot<GlobalSettings> globalSettings, IUmbracoMapper mapper, BackOfficeErrorDescriber describer, AppCaches appCaches, ITwoFactorLoginService twoFactorLoginService, IUserGroupService userGroupService, IUserRepository userRepository, IRuntimeState runtimeState, IEventMessagesFactory eventMessagesFactory, ILogger<BackOfficeUserStore> logger)
Parameters
Methods
View Source
AddLoginAsync(BackOfficeIdentityUser, UserLoginInfo, CancellationToken)
Declaration
public override Task AddLoginAsync(BackOfficeIdentityUser user, UserLoginInfo login, CancellationToken cancellationToken = null)
Parameters
Returns
View Source
CreateAsync(BackOfficeIdentityUser, CancellationToken)
Declaration
public override Task<IdentityResult> CreateAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = null)
Parameters
Returns
| Type |
Description |
| Task<IdentityResult> |
|
View Source
DeleteAsync(BackOfficeIdentityUser, CancellationToken)
Declaration
public override Task<IdentityResult> DeleteAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = null)
Parameters
Returns
| Type |
Description |
| Task<IdentityResult> |
|
View Source
DisableAsync(IUser)
Declaration
public Task<UserOperationStatus> DisableAsync(IUser user)
Parameters
| Type |
Name |
Description |
| IUser |
user |
|
Returns
View Source
FindByEmailAsync(String, CancellationToken)
Declaration
public override async Task<BackOfficeIdentityUser> FindByEmailAsync(string email, CancellationToken cancellationToken = null)
Parameters
| Type |
Name |
Description |
| System.String |
email |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
FindByNameAsync(String, CancellationToken)
Declaration
public override async Task<BackOfficeIdentityUser> FindByNameAsync(string userName, CancellationToken cancellationToken = null)
Parameters
| Type |
Name |
Description |
| System.String |
userName |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
FindRoleAsync(String, CancellationToken)
Declaration
protected override Task<IdentityRole<string>?> FindRoleAsync(string normalizedRoleName, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| System.String |
normalizedRoleName |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<System.Nullable<IdentityRole<System.String>>> |
|
View Source
FindUserAsync(String, CancellationToken)
Declaration
protected override Task<BackOfficeIdentityUser> FindUserAsync(string userId, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| System.String |
userId |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
FindUserLoginAsync(String, String, CancellationToken)
Declaration
protected override Task<IdentityUserLogin<string>?> FindUserLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| System.String |
loginProvider |
|
| System.String |
providerKey |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<System.Nullable<Umbraco.Cms.Core.Security.IdentityUserLogin<System.String>>> |
|
View Source
FindUserLoginAsync(String, String, String, CancellationToken)
Declaration
protected override async Task<IdentityUserLogin<string>?> FindUserLoginAsync(string userId, string loginProvider, string providerKey, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| System.String |
userId |
|
| System.String |
loginProvider |
|
| System.String |
providerKey |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<System.Nullable<Umbraco.Cms.Core.Security.IdentityUserLogin<System.String>>> |
|
View Source
FindUserRoleAsync(String, String, CancellationToken)
Declaration
protected override async Task<IdentityUserRole<string>?> FindUserRoleAsync(string userId, string roleId, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| System.String |
userId |
|
| System.String |
roleId |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<System.Nullable<IdentityUserRole<System.String>>> |
|
View Source
GetAllInGroupAsync(Int32)
Declaration
public Task<IEnumerable<IUser>> GetAllInGroupAsync(int groupId)
Parameters
| Type |
Name |
Description |
| System.Int32 |
groupId |
|
Returns
| Type |
Description |
| Task<IEnumerable<IUser>> |
|
View Source
GetAsync(Guid)
Declaration
public Task<IUser> GetAsync(Guid key)
Parameters
| Type |
Name |
Description |
| Guid |
key |
|
Returns
| Type |
Description |
| Task<IUser> |
|
View Source
GetAsync(Int32)
Declaration
public Task<IUser> GetAsync(int id)
Parameters
| Type |
Name |
Description |
| System.Int32 |
id |
|
Returns
| Type |
Description |
| Task<IUser> |
|
View Source
GetByEmailAsync(String)
Declaration
public Task<IUser> GetByEmailAsync(string email)
Parameters
| Type |
Name |
Description |
| System.String |
email |
|
Returns
| Type |
Description |
| Task<IUser> |
|
View Source
GetByUserNameAsync(String)
Declaration
public Task<IUser> GetByUserNameAsync(string username)
Parameters
| Type |
Name |
Description |
| System.String |
username |
|
Returns
| Type |
Description |
| Task<IUser> |
|
View Source
GetLoginsAsync(BackOfficeIdentityUser, CancellationToken)
Declaration
public override Task<IList<UserLoginInfo>> GetLoginsAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = null)
Parameters
Returns
| Type |
Description |
| Task<IList<UserLoginInfo>> |
|
View Source
GetTokenAsync(BackOfficeIdentityUser, String, String, CancellationToken)
Overridden to support Umbraco's own data storage requirements
Declaration
public override Task<string> GetTokenAsync(BackOfficeIdentityUser user, string loginProvider, string name, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| BackOfficeIdentityUser |
user |
|
| System.String |
loginProvider |
|
| System.String |
name |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<System.String> |
|
View Source
GetTwoFactorEnabledAsync(BackOfficeIdentityUser, CancellationToken)
Declaration
public override async Task<bool> GetTwoFactorEnabledAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = null)
Parameters
Returns
| Type |
Description |
| Task<System.Boolean> |
|
View Source
GetUsersAsync(Guid[])
Declaration
public Task<IEnumerable<IUser>> GetUsersAsync(params Guid[] keys)
Parameters
| Type |
Name |
Description |
| Guid[] |
keys |
|
Returns
| Type |
Description |
| Task<IEnumerable<IUser>> |
|
View Source
GetUsersAsync(Int32[])
Declaration
public Task<IEnumerable<IUser>> GetUsersAsync(params int[] ids)
Parameters
| Type |
Name |
Description |
| System.Int32[] |
ids |
|
Returns
| Type |
Description |
| Task<IEnumerable<IUser>> |
|
View Source
GetUsersInRoleAsync(String, CancellationToken)
Lists all users of a given role.
Declaration
public override async Task<IList<BackOfficeIdentityUser>> GetUsersInRoleAsync(string normalizedRoleName, CancellationToken cancellationToken = null)
Parameters
| Type |
Name |
Description |
| System.String |
normalizedRoleName |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
RemoveLoginAsync(BackOfficeIdentityUser, String, String, CancellationToken)
Declaration
public override Task RemoveLoginAsync(BackOfficeIdentityUser user, string loginProvider, string providerKey, CancellationToken cancellationToken = null)
Parameters
| Type |
Name |
Description |
| BackOfficeIdentityUser |
user |
|
| System.String |
loginProvider |
|
| System.String |
providerKey |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
RemoveTokenAsync(BackOfficeIdentityUser, String, String, CancellationToken)
Overridden to support Umbraco's own data storage requirements
Declaration
public override Task RemoveTokenAsync(BackOfficeIdentityUser user, string loginProvider, string name, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| BackOfficeIdentityUser |
user |
|
| System.String |
loginProvider |
|
| System.String |
name |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
ResolveEntityIdFromIdentityId(String)
Declaration
protected override async Task<int> ResolveEntityIdFromIdentityId(string identityId)
Parameters
| Type |
Name |
Description |
| System.String |
identityId |
|
Returns
| Type |
Description |
| Task<System.Int32> |
|
View Source
SaveAsync(IUser)
Declaration
public Task<UserOperationStatus> SaveAsync(IUser user)
Parameters
| Type |
Name |
Description |
| IUser |
user |
|
Returns
View Source
SetPasswordHashAsync(BackOfficeIdentityUser, String, CancellationToken)
Declaration
public override async Task SetPasswordHashAsync(BackOfficeIdentityUser user, string passwordHash, CancellationToken cancellationToken = null)
Parameters
| Type |
Name |
Description |
| BackOfficeIdentityUser |
user |
|
| System.String |
passwordHash |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
SetTokenAsync(BackOfficeIdentityUser, String, String, String, CancellationToken)
Overridden to support Umbraco's own data storage requirements
Declaration
public override Task SetTokenAsync(BackOfficeIdentityUser user, string loginProvider, string name, string value, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| BackOfficeIdentityUser |
user |
|
| System.String |
loginProvider |
|
| System.String |
name |
|
| System.String |
value |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
UpdateAsync(BackOfficeIdentityUser, CancellationToken)
Declaration
public override Task<IdentityResult> UpdateAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = null)
Parameters
Returns
| Type |
Description |
| Task<IdentityResult> |
|
View Source
ValidateSessionIdAsync(String, String)
Validates a user's session is still valid
Declaration
public async Task<bool> ValidateSessionIdAsync(string userId, string sessionId)
Parameters
| Type |
Name |
Description |
| System.String |
userId |
|
| System.String |
sessionId |
|
Returns
| Type |
Description |
| Task<System.Boolean> |
|