Search Results for

    Show / Hide Table of Contents
    View Source

    Class TwoFactorValidationProvider<TUmbracoIdentityUser, TTwoFactorSetupGenerator>

    Inheritance
    object
    DataProtectorTokenProvider<TUmbracoIdentityUser>
    Namespace: Umbraco.Cms.Infrastructure.Security
    Assembly: Umbraco.Web.Common.dll
    Syntax
    public class TwoFactorValidationProvider<TUmbracoIdentityUser, TTwoFactorSetupGenerator> : DataProtectorTokenProvider<TUmbracoIdentityUser> where TUmbracoIdentityUser : UmbracoIdentityUser where TTwoFactorSetupGenerator : ITwoFactorProvider
    Type Parameters
    Name Description
    TUmbracoIdentityUser
    TTwoFactorSetupGenerator

    Constructors

    View Source

    TwoFactorValidationProvider(IDataProtectionProvider, IOptions<DataProtectionTokenProviderOptions>, ILogger<TwoFactorValidationProvider<TUmbracoIdentityUser, TTwoFactorSetupGenerator>>, ITwoFactorLoginService, TTwoFactorSetupGenerator)

    Declaration
    protected TwoFactorValidationProvider(IDataProtectionProvider dataProtectionProvider, IOptions<DataProtectionTokenProviderOptions> options, ILogger<TwoFactorValidationProvider<TUmbracoIdentityUser, TTwoFactorSetupGenerator>> logger, ITwoFactorLoginService twoFactorLoginService, TTwoFactorSetupGenerator generator)
    Parameters
    Type Name Description
    IDataProtectionProvider dataProtectionProvider
    IOptions<DataProtectionTokenProviderOptions> options
    ILogger<TwoFactorValidationProvider<TUmbracoIdentityUser, TTwoFactorSetupGenerator>> logger
    ITwoFactorLoginService twoFactorLoginService
    TTwoFactorSetupGenerator generator

    Methods

    View Source

    CanGenerateTwoFactorTokenAsync(UserManager<TUmbracoIdentityUser>, TUmbracoIdentityUser)

    Returns a bool indicating whether a token generated by this instance can be used as a Two Factor Authentication token as an asynchronous operation.

    Declaration
    public override Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<TUmbracoIdentityUser> manager, TUmbracoIdentityUser user)
    Parameters
    Type Name Description
    UserManager<TUmbracoIdentityUser> manager

    The Microsoft.AspNetCore.Identity.UserManager<TUser> to retrieve user properties from.

    TUmbracoIdentityUser user

    The TUser the token was generated for.

    Returns
    Type Description
    Task<bool>

    A System.Threading.Tasks.Task<TResult> that represents the result of the asynchronous query, containing true if a token generated by this instance can be used as a Two Factor Authentication token, otherwise false.

    Remarks

    This method will always return false for instances of Microsoft.AspNetCore.Identity.DataProtectorTokenProvider<TUser>.

    View Source

    GetUserKey(TUmbracoIdentityUser)

    Declaration
    protected Guid GetUserKey(TUmbracoIdentityUser user)
    Parameters
    Type Name Description
    TUmbracoIdentityUser user
    Returns
    Type Description
    Guid
    View Source

    ValidateAsync(string, string, UserManager<TUmbracoIdentityUser>, TUmbracoIdentityUser)

    Validates the protected token for the specified user and purpose as an asynchronous operation.

    Declaration
    public override Task<bool> ValidateAsync(string purpose, string token, UserManager<TUmbracoIdentityUser> manager, TUmbracoIdentityUser user)
    Parameters
    Type Name Description
    string purpose

    The purpose the token was be used for.

    string token

    The token to validate.

    UserManager<TUmbracoIdentityUser> manager

    The Microsoft.AspNetCore.Identity.UserManager<TUser> to retrieve user properties from.

    TUmbracoIdentityUser user

    The TUser the token was generated for.

    Returns
    Type Description
    Task<bool>

    A System.Threading.Tasks.Task<TResult> that represents the result of the asynchronous validation, containing true if the token is valid, otherwise false.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX