code: public static Principal getPrincipalFromRequestContext(final RequestContext requestContext,
                                                             final TicketRegistrySupport ticketRegistrySupport) {
          val tgt = WebUtils.getTicketGrantingTicketId(requestContext);
          if (StringUtils.isBlank(tgt)) {
              throw new IllegalArgumentException("No ticket-granting ticket could be found in the context");
          }
  
          return ticketRegistrySupport.getAuthenticatedPrincipalFrom(tgt);
      }
docs: Gets the authenticated principal.
  
  @param requestContext        the request context
  @param ticketRegistrySupport the ticket registry support
  @return the principal