public static String getTicketGrantingTicketId(final RequestContext context) {
        val tgtFromRequest = getTicketGrantingTicketIdFrom(context.getRequestScope());
        val tgtFromFlow = getTicketGrantingTicketIdFrom(context.getFlowScope());
        return Optional.ofNullable(tgtFromRequest).orElse(tgtFromFlow);
    }
Gets the ticket granting ticket id from the request and flow scopes.

@param context the context
@return the ticket granting ticket id
core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java