コード例 #1
0
        public async Task SendAsync()
        {
            var verifyFactorOptions = new VerifySmsFactorOptions()
            {
                StateToken = this.stateController.StateToken,
                FactorId   = this.Id,
            };

            var authResponse = await this.authnClient.VerifyFactorAsync(verifyFactorOptions);

            this.stateController.ProcessAuthnResponse(authResponse);
        }
コード例 #2
0
        public ActionResult VerifyFactor()
        {
            var isMfaRequiredFlow = (bool)Session["isMfaRequiredFlow"];

            if (isMfaRequiredFlow)
            {
                // Assuming Phone: Send code to phone
                var verifyFactorOptions = new VerifySmsFactorOptions
                {
                    StateToken = Session["stateToken"].ToString(),
                    FactorId   = Session["factorId"].ToString(),
                };

                _oktaAuthenticationClient.VerifyFactorAsync(verifyFactorOptions).ConfigureAwait(false);
            }

            var viewModel = new VerifyFactorViewModel
            {
                IsMfaRequiredFlow = isMfaRequiredFlow,
            };

            return(View(viewModel));
        }