Example #1
0
        public async Task <bool> TwoFactorBrowserRememberedAsync(string userId, int?tenantId)
        {
            var result = await AuthenticationManager.AuthenticateAsync(_configuration.TwoFactorRememberBrowserAuthenticationScheme);

            if (result?.Identity == null)
            {
                return(false);
            }

            if (IdentityExtensions.GetUserId(result.Identity) != userId)
            {
                return(false);
            }

            if (AbpZeroClaimsIdentityHelper.GetTenantId(result.Identity) != tenantId)
            {
                return(false);
            }

            return(true);
        }
Example #2
0
        public virtual async Task <int?> GetVerifiedTenantIdAsync()
        {
            var authenticateResult = await AuthenticationManager.AuthenticateAsync(_configuration.TwoFactorAuthenticationScheme);

            return(AbpZeroClaimsIdentityHelper.GetTenantId(authenticateResult?.Identity));
        }