@Override
    protected Event doExecuteInternal(final RequestContext requestContext) throws Exception {
        var accountRegTicket = (TransientSessionTicket) null;
        try {
            val activationToken = WebUtils.getRequestParameterOrAttribute(requestContext, AccountRegistrationUtils.REQUEST_PARAMETER_ACCOUNT_REGISTRATION_ACTIVATION_TOKEN).orElseThrow();
            accountRegTicket = ticketRegistry.getTicket(activationToken, TransientSessionTicket.class);
            val token = accountRegTicket.getProperty(AccountRegistrationUtils.PROPERTY_ACCOUNT_REGISTRATION_ACTIVATION_TOKEN, String.class);
            val registrationRequest = accountRegistrationService.validateToken(token);
            accountRegTicket.update();

            val username = accountRegistrationService.getAccountRegistrationUsernameBuilder().build(registrationRequest);
            AccountRegistrationUtils.putAccountRegistrationRequest(requestContext, registrationRequest);
            AccountRegistrationUtils.putAccountRegistrationRequestUsername(requestContext, username);

            return success(registrationRequest);
        } catch (final Exception e) {
            LoggingUtils.warn(LOGGER, e);
            requestContext.getFlashScope().put(CasWebflowConstants.ATTRIBUTE_ERROR_ROOT_CAUSE_EXCEPTION,
                RootCasException.withCode("screen.error.page.invalidrequest.desc"));
            return error(e);
        } finally {
            if (accountRegTicket != null && accountRegTicket.isExpired()) {
                ticketRegistry.deleteTicket(accountRegTicket);
            }
        }
    }
This is {@link ValidateAccountRegistrationTokenAction}.

@author Misagh Moayyed
@since 6.5.0
support/cas-server-support-account-mgmt/src/main/java/org/apereo/cas/acct/webflow/ValidateAccountRegistrationTokenAction.java