Beispiel #1
0
        public async Task <OtpActivationRequestParams> GetAsync(OtpDeactivationRequest credentials)
        {
            var principal = _httpContextAccessor.HttpContext.User;
            var user      = await _currentUserProvider.GetUserAsync(principal);

            var userId         = user.Id;
            var secretKeyBytes = await _otpSecretKeyProvider.ReadAsync(userId);

            return(new OtpActivationRequestParams
            {
                UserId = userId,
                SecretKey = secretKeyBytes,
                Otp = credentials.Otp,
                Password = credentials.Password
            });
        }
Beispiel #2
0
 public async Task <bool> Validate(Guid userId, int credentialsCode)
 {
     return(_otpCodeValidationService.Validate(await _otpSecretKeyProvider.ReadAsync(userId), credentialsCode));
 }