Ejemplo n.º 1
0
        public override async Task <bool> IsTwoFactorClientRememberedAsync(TUser user)
        {
            var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorRememberMeScheme);

            return(result?.Principal != null &&
                   result.Principal.FindFirstValue(ClaimTypes.Name) == user.Id.ToString() &&
                   AbpZeroClaimsIdentityHelper.GetTenantId(result.Principal) == user.TenantId);
        }
Ejemplo n.º 2
0
        public override async Task <bool> IsTwoFactorClientRememberedAsync(TUser user)
        {
            var result = await Context.Authentication.AuthenticateAsync(Options.Cookies.TwoFactorRememberMeCookieAuthenticationScheme);

            return(result != null &&
                   result.FindFirstValue(ClaimTypes.Name) == user.Id.ToString() &&
                   AbpZeroClaimsIdentityHelper.GetTenantId(result) == user.TenantId);
        }
Ejemplo n.º 3
0
        public async Task <int?> GetVerifiedTenantIdAsync()
        {
            var result = await Context.AuthenticateAsync(IdentityConstants.TwoFactorUserIdScheme);

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

            return(AbpZeroClaimsIdentityHelper.GetTenantId(result.Principal));
        }
Ejemplo n.º 4
0
        public async Task <int?> GetVerifiedTenantIdAsync()
        {
            var principal = await Context.Authentication.AuthenticateAsync(Options.Cookies.TwoFactorUserIdCookieAuthenticationScheme);

            if (principal == null)
            {
                return(null);
            }

            return(AbpZeroClaimsIdentityHelper.GetTenantId(principal));
        }