@Override
    protected Event doExecuteInternal(final RequestContext requestContext) {
        WebUtils.putPasswordManagementEnabled(requestContext, casProperties.getAuthn().getPm().getCore().isEnabled());
        WebUtils.putForgotUsernameEnabled(requestContext, casProperties.getAuthn().getPm().getForgotUsername().isEnabled());
        WebUtils.putAccountProfileManagementEnabled(requestContext, true);
        val secQuestionsEnabled = casProperties.getAuthn().getPm().getReset().isSecurityQuestionsEnabled()
                                  && casProperties.getAuthn().getPm().getCore().isEnabled();
        WebUtils.putSecurityQuestionsEnabled(requestContext, secQuestionsEnabled);
        val tgt = WebUtils.getTicketGrantingTicket(requestContext);
        return FunctionUtils.doUnchecked(() -> {
            if (secQuestionsEnabled && tgt instanceof final AuthenticationAwareTicket aat) {
                val principal = aat.getAuthentication().getPrincipal();
                val query = PasswordManagementQuery.builder().username(principal.getId()).build();
                val questions = passwordManagementService.getSecurityQuestions(query);
                PasswordManagementWebflowUtils.putPasswordResetSecurityQuestions(requestContext, questions);
            }
            return null;
        });
    }
This is {@link AccountProfilePreparePasswordManagementAction}.

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