@Override
    public SecurityTokenTicket create(final TicketGrantingTicket ticket,
                                      final byte[] securityTokenSerialized) throws Throwable {
        val token = EncodingUtils.encodeBase64(securityTokenSerialized);
        val id = ticketUniqueTicketIdGenerator.getNewTicketId(SecurityTokenTicket.PREFIX);
        val stt = new DefaultSecurityTokenTicket(id, ticket, this.expirationPolicyBuilder.buildTicketExpirationPolicy(), token);
        ticket.getDescendantTickets().add(stt.getId());
        return stt;
    }
This is {@link DefaultSecurityTokenTicketFactory}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-ws-sts-api/src/main/java/org/apereo/cas/ticket/DefaultSecurityTokenTicketFactory.java