private Optional<Authentication> getSingleSignOnAuthenticationFrom(final RequestContext requestContext) {
        val tgtId = WebUtils.getTicketGrantingTicketId(requestContext);
        if (StringUtils.isBlank(tgtId)) {
            LOGGER.trace("No ticket-granting ticket could be located in the webflow context");
            return Optional.empty();
        }
        val ticket = configurationContext.getTicketRegistry().getTicket(tgtId, TicketGrantingTicket.class);
        LOGGER.trace("Located a valid ticket-granting ticket");
        return Optional.of(ticket.getAuthentication());
    }
Resolve service from request context.

@param context the context
@return the service
support/cas-server-support-pac4j-core/src/main/java/org/apereo/cas/web/flow/DelegatedAuthenticationSingleSignOnEvaluator.java