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>
   
  Constructors
  
  
    View Source
  
  BackOfficeUserStore(ICoreScopeProvider, IUserService, IEntityService, IExternalLoginWithKeyService, IOptions<GlobalSettings>, IUmbracoMapper, BackOfficeErrorDescriber, AppCaches)
  
  
  Declaration
  
    public BackOfficeUserStore(ICoreScopeProvider scopeProvider, IUserService userService, IEntityService entityService, IExternalLoginWithKeyService externalLoginService, IOptions<GlobalSettings> globalSettings, IUmbracoMapper mapper, BackOfficeErrorDescriber describer, AppCaches appCaches)
   
  Parameters
  
  
    View Source
  
  BackOfficeUserStore(ICoreScopeProvider, IUserService, IEntityService, IExternalLoginWithKeyService, IOptionsSnapshot<GlobalSettings>, IUmbracoMapper, BackOfficeErrorDescriber, AppCaches, ITwoFactorLoginService)
  
  
  Declaration
  
    public BackOfficeUserStore(ICoreScopeProvider scopeProvider, IUserService userService, IEntityService entityService, IExternalLoginWithKeyService externalLoginService, IOptionsSnapshot<GlobalSettings> globalSettings, IUmbracoMapper mapper, BackOfficeErrorDescriber describer, AppCaches appCaches, ITwoFactorLoginService twoFactorLoginService)
   
  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
  
  FindByEmailAsync(String, CancellationToken)
  
  
  Declaration
  
    public override 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 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
  
  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
  
  GetUsersInRoleAsync(String, CancellationToken)
  Lists all users of a given role.
 
  
  Declaration
  
    public override 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
  
  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 Task<bool> ValidateSessionIdAsync(string userId, string sessionId)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        userId | 
         | 
      
      
        | System.String | 
        sessionId | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Task<System.Boolean> | 
         |