Пример #1
0
    public async Task <ActionResult <IEnumerable <string> > > Get2FAProviders()
    {
        BackOfficeIdentityUser?user = await _signInManager.GetTwoFactorAuthenticationUserAsync();

        if (user == null)
        {
            _logger.LogWarning("Get2FAProviders :: No verified user found, returning 404");
            return(NotFound());
        }

        IEnumerable <string> userFactors = await _twoFactorLoginService.GetEnabledTwoFactorProviderNamesAsync(user.Key);

        return(new ObjectResult(userFactors));
    }
Пример #2
0
        public async Task <ActionResult <IEnumerable <string> > > Get2FAProviders()
        {
            var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();

            if (user == null)
            {
                _logger.LogWarning("Get2FAProviders :: No verified user found, returning 404");
                return(NotFound());
            }

            var userFactors = await _userManager.GetValidTwoFactorProvidersAsync(user);

            return(new ObjectResult(userFactors));
        }
    public async Task <ActionResult <IEnumerable <string> > > GetEnabled2FAProvidersForCurrentUser()
    {
        BackOfficeIdentityUser?user = await _backOfficeSignInManager.GetTwoFactorAuthenticationUserAsync();

        if (user == null)
        {
            _logger.LogWarning("No verified user found, returning 404");
            return(NotFound());
        }

        IList <string> userFactors = await _backOfficeUserManager.GetValidTwoFactorProvidersAsync(user);

        return(new ObjectResult(userFactors));
    }