@Override
    public String build(final Authentication authentication,
                        final RegisteredService registeredService,
                        final String jwtIdentifier,
                        final Map<String, List<Object>> claims) throws Throwable {
        val attributes = new HashMap<>(authentication.getAttributes());
        attributes.putAll(authentication.getPrincipal().getAttributes());
        attributes.putAll(claims);

        val expirationPolicy = ticketFactory.get(TicketGrantingTicket.class).getExpirationPolicyBuilder();
        val dt = ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(getTimeToLive(expirationPolicy, registeredService));
        val validUntilDate = DateTimeUtils.dateOf(dt);

        val builder = JwtBuilder.JwtRequest.builder();
        val request = builder
            .serviceAudience(Set.of(casProperties.getServer().getPrefix()))
            .registeredService(Optional.ofNullable(registeredService))
            .issueDate(DateTimeUtils.dateOf(authentication.getAuthenticationDate()))
            .jwtId(jwtIdentifier)
            .subject(authentication.getPrincipal().getId())
            .validUntilDate(validUntilDate)
            .attributes(attributes)
            .issuer(casProperties.getServer().getPrefix())
            .build();
        return jwtBuilder.build(request);
    }
This is {@link JwtTicketBuilder}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-token-core-api/src/main/java/org/apereo/cas/token/JwtTicketBuilder.java