code: public Ticket store(final J2EContext webContext, final BaseClient client) {
          val properties = buildTicketProperties(webContext);
  
          val originalService = argumentExtractor.extractService(webContext.getRequest());
          val service = authenticationRequestServiceSelectionStrategies.resolveService(originalService);
          properties.put(CasProtocolConstants.PARAMETER_SERVICE, originalService);
          properties.put(CasProtocolConstants.PARAMETER_TARGET_SERVICE, service);
  
          val transientFactory = (TransientSessionTicketFactory) this.ticketFactory.get(TransientSessionTicket.class);
          val ticket = transientFactory.create(originalService, properties);
          val ticketId = ticket.getId();
          LOGGER.debug("Storing delegated authentication request ticket [{}] for service [{}] with properties [{}]",
              ticketId, ticket.getService(), ticket.getProperties());
          this.ticketRegistry.addTicket(ticket);
          webContext.setRequestAttribute(PARAMETER_CLIENT_ID, ticketId);
  
          val sessionStore = webContext.getSessionStore();
          if (client instanceof SAML2Client) {
              sessionStore.set(webContext, SAML2StateGenerator.SAML_RELAY_STATE_ATTRIBUTE, ticketId);
          }
          if (client instanceof OAuth20Client) {
              val oauthClient = (OAuth20Client) client;
              val config = oauthClient.getConfiguration();
              config.setWithState(true);
              config.setStateGenerator(new StaticOrRandomStateGenerator(ticketId));
          }
          if (client instanceof OidcClient) {
              val oidcClient = (OidcClient) client;
              val config = oidcClient.getConfiguration();
              config.addCustomParam(PARAMETER_CLIENT_ID, ticketId);
              config.setWithState(true);
              config.setStateGenerator(new StaticOrRandomStateGenerator(ticketId));
          }
          if (client instanceof CasClient) {
              val casClient = (CasClient) client;
              val config = casClient.getConfiguration();
              config.addCustomParam(DelegatedClientWebflowManager.PARAMETER_CLIENT_ID, ticketId);
          }
          if (client instanceof OAuth10Client) {
              sessionStore.set(webContext, OAUTH10_CLIENT_ID_SESSION_KEY, ticket.getId());
          }
          return ticket;
      }
docs: Store.
  
  @param webContext the web context
  @param client     the client
  @return the ticket