Search Results for

    Show / Hide Table of Contents
    View Source

    Class MemberUserStore

    A custom user store that uses Umbraco member data

    Inheritance
    System.Object
    UmbracoUserStore<MemberIdentityUser, UmbracoIdentityRole>
    Namespace: Umbraco.Cms.Core.Security
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public class MemberUserStore : UmbracoUserStore<MemberIdentityUser, UmbracoIdentityRole>, IMemberUserStore

    Constructors

    View Source

    MemberUserStore(IMemberService, IUmbracoMapper, ICoreScopeProvider, IdentityErrorDescriber, IPublishedSnapshotAccessor)

    Declaration
    public MemberUserStore(IMemberService memberService, IUmbracoMapper mapper, ICoreScopeProvider scopeProvider, IdentityErrorDescriber describer, IPublishedSnapshotAccessor publishedSnapshotAccessor)
    Parameters
    Type Name Description
    IMemberService memberService
    IUmbracoMapper mapper
    ICoreScopeProvider scopeProvider
    IdentityErrorDescriber describer
    IPublishedSnapshotAccessor publishedSnapshotAccessor
    View Source

    MemberUserStore(IMemberService, IUmbracoMapper, ICoreScopeProvider, IdentityErrorDescriber, IPublishedSnapshotAccessor, IExternalLoginService)

    Declaration
    public MemberUserStore(IMemberService memberService, IUmbracoMapper mapper, ICoreScopeProvider scopeProvider, IdentityErrorDescriber describer, IPublishedSnapshotAccessor publishedSnapshotAccessor, IExternalLoginService externalLoginService)
    Parameters
    Type Name Description
    IMemberService memberService
    IUmbracoMapper mapper
    ICoreScopeProvider scopeProvider
    IdentityErrorDescriber describer
    IPublishedSnapshotAccessor publishedSnapshotAccessor
    IExternalLoginService externalLoginService
    View Source

    MemberUserStore(IMemberService, IUmbracoMapper, ICoreScopeProvider, IdentityErrorDescriber, IPublishedSnapshotAccessor, IExternalLoginWithKeyService, ITwoFactorLoginService)

    Initializes a new instance of the MemberUserStore class for the members identity store

    Declaration
    public MemberUserStore(IMemberService memberService, IUmbracoMapper mapper, ICoreScopeProvider scopeProvider, IdentityErrorDescriber describer, IPublishedSnapshotAccessor publishedSnapshotAccessor, IExternalLoginWithKeyService externalLoginService, ITwoFactorLoginService twoFactorLoginService)
    Parameters
    Type Name Description
    IMemberService memberService

    The member service

    IUmbracoMapper mapper

    The mapper for properties

    ICoreScopeProvider scopeProvider

    The scope provider

    IdentityErrorDescriber describer

    The error describer

    IPublishedSnapshotAccessor publishedSnapshotAccessor

    The published snapshot accessor

    IExternalLoginWithKeyService externalLoginService

    The external login service

    ITwoFactorLoginService twoFactorLoginService

    The two factor login service

    Methods

    View Source

    AddLoginAsync(MemberIdentityUser, UserLoginInfo, CancellationToken)

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

    CreateAsync(MemberIdentityUser, CancellationToken)

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

    DeleteAsync(MemberIdentityUser, CancellationToken)

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

    FindByEmailAsync(String, CancellationToken)

    Declaration
    public override Task<MemberIdentityUser> FindByEmailAsync(string email, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    System.String email
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<MemberIdentityUser>
    View Source

    FindByNameAsync(String, CancellationToken)

    Declaration
    public override Task<MemberIdentityUser> FindByNameAsync(string userName, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    System.String userName
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<MemberIdentityUser>
    View Source

    FindRoleAsync(String, CancellationToken)

    Declaration
    protected override Task<UmbracoIdentityRole> FindRoleAsync(string roleName, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.String roleName
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<UmbracoIdentityRole>
    View Source

    FindUserAsync(String, CancellationToken)

    Declaration
    protected override Task<MemberIdentityUser> FindUserAsync(string userId, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.String userId
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<MemberIdentityUser>
    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<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<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<IdentityUserRole<System.String>>
    View Source

    GetLoginsAsync(MemberIdentityUser, CancellationToken)

    Declaration
    public override Task<IList<UserLoginInfo>> GetLoginsAsync(MemberIdentityUser user, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    MemberIdentityUser user
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IList<UserLoginInfo>>
    View Source

    GetPublishedMember(MemberIdentityUser)

    Declaration
    public IPublishedContent GetPublishedMember(MemberIdentityUser user)
    Parameters
    Type Name Description
    MemberIdentityUser user
    Returns
    Type Description
    IPublishedContent
    View Source

    GetRolesAsync(MemberIdentityUser, CancellationToken)

    Gets a list of role names the specified user belongs to.

    Declaration
    public override Task<IList<string>> GetRolesAsync(MemberIdentityUser user, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    MemberIdentityUser user
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IList<System.String>>
    Remarks

    This lazy loads the roles for the member

    View Source

    GetTokenAsync(MemberIdentityUser, String, String, CancellationToken)

    Overridden to support Umbraco's own data storage requirements

    Declaration
    public override Task<string> GetTokenAsync(MemberIdentityUser user, string loginProvider, string name, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    MemberIdentityUser user
    System.String loginProvider
    System.String name
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<System.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(MemberIdentityUser, CancellationToken)

    Declaration
    public override async Task<bool> GetTwoFactorEnabledAsync(MemberIdentityUser user, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    MemberIdentityUser user
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<System.Boolean>
    View Source

    GetUsersInRoleAsync(String, CancellationToken)

    Lists all users of a given role.

    Declaration
    public override Task<IList<MemberIdentityUser>?> GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    System.String roleName
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<System.Nullable<IList<MemberIdentityUser>>>
    View Source

    IsInRoleAsync(MemberIdentityUser, String, CancellationToken)

    Returns true if a user is in the role

    Declaration
    public override Task<bool> IsInRoleAsync(MemberIdentityUser user, string roleName, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    MemberIdentityUser user
    System.String roleName
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<System.Boolean>
    View Source

    RemoveLoginAsync(MemberIdentityUser, String, String, CancellationToken)

    Declaration
    public override Task RemoveLoginAsync(MemberIdentityUser user, string loginProvider, string providerKey, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    MemberIdentityUser user
    System.String loginProvider
    System.String providerKey
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    View Source

    SetTokenAsync(MemberIdentityUser, String, String, String, CancellationToken)

    Overridden to support Umbraco's own data storage requirements

    Declaration
    public override Task SetTokenAsync(MemberIdentityUser user, string loginProvider, string name, string value, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    MemberIdentityUser user
    System.String loginProvider
    System.String name
    System.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(MemberIdentityUser, CancellationToken)

    Declaration
    public override Task<IdentityResult> UpdateAsync(MemberIdentityUser user, CancellationToken cancellationToken = null)
    Parameters
    Type Name Description
    MemberIdentityUser user
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IdentityResult>
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • MemberUserStore(IMemberService, IUmbracoMapper, ICoreScopeProvider, IdentityErrorDescriber, IPublishedSnapshotAccessor)
      • MemberUserStore(IMemberService, IUmbracoMapper, ICoreScopeProvider, IdentityErrorDescriber, IPublishedSnapshotAccessor, IExternalLoginService)
      • MemberUserStore(IMemberService, IUmbracoMapper, ICoreScopeProvider, IdentityErrorDescriber, IPublishedSnapshotAccessor, IExternalLoginWithKeyService, ITwoFactorLoginService)
    • Methods
      • AddLoginAsync(MemberIdentityUser, UserLoginInfo, CancellationToken)
      • CreateAsync(MemberIdentityUser, CancellationToken)
      • DeleteAsync(MemberIdentityUser, CancellationToken)
      • FindByEmailAsync(String, CancellationToken)
      • FindByNameAsync(String, CancellationToken)
      • FindRoleAsync(String, CancellationToken)
      • FindUserAsync(String, CancellationToken)
      • FindUserLoginAsync(String, String, CancellationToken)
      • FindUserLoginAsync(String, String, String, CancellationToken)
      • FindUserRoleAsync(String, String, CancellationToken)
      • GetLoginsAsync(MemberIdentityUser, CancellationToken)
      • GetPublishedMember(MemberIdentityUser)
      • GetRolesAsync(MemberIdentityUser, CancellationToken)
      • GetTokenAsync(MemberIdentityUser, String, String, CancellationToken)
      • GetTwoFactorEnabledAsync(MemberIdentityUser, CancellationToken)
      • GetUsersInRoleAsync(String, CancellationToken)
      • IsInRoleAsync(MemberIdentityUser, String, CancellationToken)
      • RemoveLoginAsync(MemberIdentityUser, String, String, CancellationToken)
      • SetTokenAsync(MemberIdentityUser, String, String, String, CancellationToken)
      • UpdateAsync(MemberIdentityUser, CancellationToken)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX