View Source
Class BackOfficeUserStore
The user store for back office users
Inheritance
object
UserStoreBase<
BackOfficeIdentityUser,
string,
IdentityUserClaim<
string>,
IdentityUserLogin<
string>,
IdentityUserToken<
string>>
UserStoreBase<
BackOfficeIdentityUser,
IdentityRole<
string>,
string,
IdentityUserClaim<
string>,
IdentityUserRole<
string>,
IdentityUserLogin<
string>,
IdentityUserToken<
string>,
IdentityRoleClaim<
string>>
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
[ActivatorUtilitiesConstructor]
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 = default)
Parameters
Returns
View Source
CreateAsync(BackOfficeIdentityUser, CancellationToken)
Declaration
public override Task<IdentityResult> CreateAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = default)
Parameters
Returns
| Type |
Description |
| Task<IdentityResult> |
|
View Source
DeleteAsync(BackOfficeIdentityUser, CancellationToken)
Declaration
public override Task<IdentityResult> DeleteAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = default)
Parameters
Returns
| Type |
Description |
| Task<IdentityResult> |
|
View Source
DisableAsync(IUser)
Declaration
public Task<UserOperationStatus> DisableAsync(IUser user)
Parameters
| Type |
Name |
Description |
| IUser |
user |
IUser to disable.
|
Returns
View Source
FindByEmailAsync(string, CancellationToken)
Declaration
public override Task<BackOfficeIdentityUser?> FindByEmailAsync(string email, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| string |
email |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
FindByNameAsync(string, CancellationToken)
Declaration
public override Task<BackOfficeIdentityUser?> FindByNameAsync(string userName, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| 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 |
| string |
normalizedRoleName |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<IdentityRole<string>> |
|
View Source
FindUserAsync(string, CancellationToken)
Declaration
protected override Task<BackOfficeIdentityUser?> FindUserAsync(string userId, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| string |
userId |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
FindUserLoginAsync(string, string, string, CancellationToken)
Declaration
protected override Task<IdentityUserLogin<string>?> FindUserLoginAsync(string userId, string loginProvider, string providerKey, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| string |
userId |
|
| string |
loginProvider |
|
| string |
providerKey |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<IdentityUserLogin<string>> |
|
View Source
FindUserLoginAsync(string, string, CancellationToken)
Declaration
protected override Task<IdentityUserLogin<string>?> FindUserLoginAsync(string loginProvider, string providerKey, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| string |
loginProvider |
|
| string |
providerKey |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<IdentityUserLogin<string>> |
|
View Source
FindUserRoleAsync(string, string, CancellationToken)
Declaration
protected override Task<IdentityUserRole<string>?> FindUserRoleAsync(string userId, string roleId, CancellationToken cancellationToken)
Parameters
| Type |
Name |
Description |
| string |
userId |
|
| string |
roleId |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<IdentityUserRole<string>> |
|
View Source
GetAllInGroupAsync(int)
Gets a list of IUser objects associated with a given group
Declaration
public Task<IEnumerable<IUser>> GetAllInGroupAsync(int groupId)
Parameters
| Type |
Name |
Description |
| int |
groupId |
Id of group.
|
Returns
| Type |
Description |
| Task<IEnumerable<IUser>> |
A task resolving into an System.Collections.Generic.IEnumerable<T>
|
View Source
GetAsync(Guid)
Declaration
public Task<IUser?> GetAsync(Guid key)
Parameters
| Type |
Name |
Description |
| Guid |
key |
Key of the user to retrieve.
|
Returns
| Type |
Description |
| Task<IUser> |
Task resolving into an IUser.
|
View Source
GetAsync(int)
Declaration
public Task<IUser?> GetAsync(int id)
Parameters
| Type |
Name |
Description |
| int |
id |
Id of the user to retrieve
|
Returns
| Type |
Description |
| Task<IUser> |
A task resolving into an IUser
|
View Source
GetByEmailAsync(string)
Declaration
public Task<IUser?> GetByEmailAsync(string email)
Parameters
| Type |
Name |
Description |
| string |
email |
Email to use for retrieval.
|
Returns
| Type |
Description |
| Task<IUser> |
A task resolving into an IUser
|
View Source
GetByUserNameAsync(string)
Declaration
public Task<IUser?> GetByUserNameAsync(string username)
Parameters
| Type |
Name |
Description |
| string |
username |
Username to use for retrieval.
|
Returns
| Type |
Description |
| Task<IUser> |
A task resolving into an IUser
|
View Source
GetLoginsAsync(BackOfficeIdentityUser, CancellationToken)
Declaration
public override Task<IList<UserLoginInfo>> GetLoginsAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = default)
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 |
|
| string |
loginProvider |
|
| string |
name |
|
| CancellationToken |
cancellationToken |
|
Returns
| Type |
Description |
| Task<string> |
|
View Source
GetTwoFactorEnabledAsync(BackOfficeIdentityUser, CancellationToken)
Declaration
public override Task<bool> GetTwoFactorEnabledAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = default)
Parameters
Returns
| Type |
Description |
| Task<bool> |
|
View Source
GetUsersAsync(params Guid[]?)
Gets users by their keys.
Declaration
public Task<IEnumerable<IUser>> GetUsersAsync(params Guid[]? keys)
Parameters
| Type |
Name |
Description |
| Guid[] |
keys |
The keys of the users to retrieve.
|
Returns
| Type |
Description |
| Task<IEnumerable<IUser>> |
A task resolving into an System.Collections.Generic.IEnumerable<T>.
|
View Source
GetUsersAsync(params int[]?)
Declaration
public Task<IEnumerable<IUser>> GetUsersAsync(params int[]? ids)
Parameters
| Type |
Name |
Description |
| int[] |
ids |
The IDs of the users to retrieve.
|
Returns
| Type |
Description |
| Task<IEnumerable<IUser>> |
A task resolving into an System.Collections.Generic.IEnumerable<T>.
|
View Source
GetUsersInRoleAsync(string, CancellationToken)
Lists all users of a given role.
Declaration
public override Task<IList<BackOfficeIdentityUser>> GetUsersInRoleAsync(string normalizedRoleName, CancellationToken cancellationToken = default)
Parameters
| Type |
Name |
Description |
| 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 = default)
Parameters
| Type |
Name |
Description |
| BackOfficeIdentityUser |
user |
|
| string |
loginProvider |
|
| 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 |
|
| string |
loginProvider |
|
| string |
name |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
ResolveEntityIdFromIdentityId(string?)
Declaration
protected override Task<int> ResolveEntityIdFromIdentityId(string? identityId)
Parameters
| Type |
Name |
Description |
| string |
identityId |
|
Returns
| Type |
Description |
| Task<int> |
|
View Source
SaveAsync(IUser)
Declaration
public Task<UserOperationStatus> SaveAsync(IUser user)
Parameters
Returns
View Source
SetPasswordHashAsync(BackOfficeIdentityUser, string?, CancellationToken)
Declaration
public override Task SetPasswordHashAsync(BackOfficeIdentityUser user, string? passwordHash, CancellationToken cancellationToken = default)
Parameters
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 |
|
| string |
loginProvider |
|
| string |
name |
|
| string |
value |
|
| CancellationToken |
cancellationToken |
|
Returns
View Source
UpdateAsync(BackOfficeIdentityUser, CancellationToken)
Declaration
public override Task<IdentityResult> UpdateAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = default)
Parameters
Returns
| Type |
Description |
| Task<IdentityResult> |
|
View Source
ValidateSessionIdAsync(string?, string?)
Validates a user's session is still valid
Declaration
public Task<bool> ValidateSessionIdAsync(string? userId, string? sessionId)
Parameters
| Type |
Name |
Description |
| string |
userId |
|
| string |
sessionId |
|
Returns
| Type |
Description |
| Task<bool> |
|