private Optional<Authentication> getAuthentication(final String ticketGrantingTicketId) {
        try {
            val ticketGrantingTicket = ticketRegistry.getTicket(ticketGrantingTicketId, TicketGrantingTicket.class);
            return Optional.of(ticketGrantingTicket.getAuthentication());
        } catch (final InvalidTicketException e) {
            LOGGER.debug(e.getMessage(), e);
        }
        LOGGER.warn("In the absence of valid ticket-granting ticket, the authentication cannot be determined");
        return Optional.empty();
    }
Action that should execute prior to rendering the generic-success login view.

@author Misagh Moayyed
@since 4.1.0
support/cas-server-support-actions-core/src/main/java/org/apereo/cas/web/flow/login/GenericSuccessViewAction.java