Search Results for

    Show / Hide Table of Contents
    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>>
    UmbracoUserStore<BackOfficeIdentityUser, IdentityRole<string>>
    Namespace: Umbraco.Cms.Core.Security
    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>)

    Initializes a new instance of the BackOfficeUserStore class.

    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
    Type Name Description
    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

    Methods

    View Source

    AddLoginAsync(BackOfficeIdentityUser, UserLoginInfo, CancellationToken)

    Declaration
    public override Task AddLoginAsync(BackOfficeIdentityUser user, UserLoginInfo login, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    BackOfficeIdentityUser user
    UserLoginInfo login
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    View Source

    CreateAsync(BackOfficeIdentityUser, CancellationToken)

    Declaration
    public override Task<IdentityResult> CreateAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    BackOfficeIdentityUser user
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IdentityResult>
    View Source

    DeleteAsync(BackOfficeIdentityUser, CancellationToken)

    Declaration
    public override Task<IdentityResult> DeleteAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    BackOfficeIdentityUser user
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IdentityResult>
    View Source

    DisableAsync(IUser)

    Disables an IUser

    Declaration
    public Task<UserOperationStatus> DisableAsync(IUser user)
    Parameters
    Type Name Description
    IUser user

    IUser to disable.

    Returns
    Type Description
    Task<UserOperationStatus>

    A task resolving into an UserOperationStatus.

    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
    Type Description
    Task<BackOfficeIdentityUser>
    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
    Type Description
    Task<BackOfficeIdentityUser>
    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
    Type Description
    Task<BackOfficeIdentityUser>
    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)

    Gets a user by it's key.

    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)

    Gets a user by Id

    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)

    Get an IUser by email

    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)

    Get an IUser by username

    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
    Type Name Description
    BackOfficeIdentityUser user
    CancellationToken cancellationToken
    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>
    Remarks

    The base class's implementation of this calls into FindTokenAsync, RemoveUserTokenAsync and AddUserTokenAsync, both methods will only work with ORMs that are change tracking ORMs like EFCore.

    View Source

    GetTwoFactorEnabledAsync(BackOfficeIdentityUser, CancellationToken)

    Declaration
    public override Task<bool> GetTwoFactorEnabledAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    BackOfficeIdentityUser user
    CancellationToken cancellationToken
    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[]?)

    Gets users by their IDs.

    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
    Type Description
    Task<IList<BackOfficeIdentityUser>>
    Remarks

    Identity Role names are equal to Umbraco UserGroup alias.

    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
    Type Description
    Task
    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
    Type Description
    Task
    Remarks

    The base class's implementation of this calls into FindTokenAsync, RemoveUserTokenAsync and AddUserTokenAsync, both methods will only work with ORMs that are change tracking ORMs like EFCore.

    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)

    Saves an IUser

    Declaration
    public Task<UserOperationStatus> SaveAsync(IUser user)
    Parameters
    Type Name Description
    IUser user

    IUser to Save

    Returns
    Type Description
    Task<UserOperationStatus>

    A task resolving into an UserOperationStatus.

    View Source

    SetPasswordHashAsync(BackOfficeIdentityUser, string?, CancellationToken)

    Declaration
    public override Task SetPasswordHashAsync(BackOfficeIdentityUser user, string? passwordHash, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    BackOfficeIdentityUser user
    string passwordHash
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    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
    Type Description
    Task
    Remarks

    The base class's implementation of this calls into FindTokenAsync and AddUserTokenAsync, both methods will only work with ORMs that are change tracking ORMs like EFCore.

    View Source

    UpdateAsync(BackOfficeIdentityUser, CancellationToken)

    Declaration
    public override Task<IdentityResult> UpdateAsync(BackOfficeIdentityUser user, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    BackOfficeIdentityUser user
    CancellationToken cancellationToken
    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>
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX