@Override
    protected Event doExecuteInternal(final RequestContext requestContext) {
        return FunctionUtils.doUnchecked(() -> {
            val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(requestContext);
            val username = PasswordManagementWebflowUtils.getPasswordResetUsername(requestContext);

            val query = PasswordManagementQuery.builder().username(username).build();
            val questions = passwordManagementService.getSecurityQuestions(query);
            val canonicalQuestions = PasswordManagementService.canonicalizeSecurityQuestions(questions);
            LOGGER.debug("Canonical security questions are [{}]", canonicalQuestions);

            val index = new AtomicInteger(0);
            val count = canonicalQuestions
                .stream()
                .filter(question -> {
                    val answer = request.getParameter("q%d".formatted(index.getAndIncrement()));
                    val answerOnRecord = questions.get(question);
                    LOGGER.trace("Validating security question [{}] with answer [{}] against provided answer [{}] by username [{}]",
                        question, answerOnRecord, answer, username);
                    return passwordManagementService.isValidSecurityQuestionAnswer(query, question, answerOnRecord, answer);
                })
                .count();
            if (count == questions.size()) {
                return success();
            }
            LOGGER.error("Unable to validate answers to all security questions; only validated [{}] question(s) successfully", count);
            return error();
        });
    }
This is {@link VerifySecurityQuestionsAction}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-pm-webflow/src/main/java/org/apereo/cas/pm/web/flow/actions/VerifySecurityQuestionsAction.java