protected void buildExpirationClaim(final JwtClaims claims, final OidcRegisteredService registeredService) {
        val expirationPolicy = getConfigurationContext().getIdTokenExpirationPolicy().buildTicketExpirationPolicy();
        val timeoutInSeconds = Optional.ofNullable(registeredService.getIdTokenExpirationPolicy())
            .map(RegisteredServiceOidcIdTokenExpirationPolicy::getTimeToKill)
            .filter(StringUtils::isNotBlank)
            .map(ttl -> Beans.newDuration(ttl).toSeconds())
            .orElseGet(expirationPolicy::getTimeToLive);
        LOGGER.debug("ID token expiration policy set to expire the ID token in [{}]", timeoutInSeconds);

        val expirationDate = NumericDate.now();
        expirationDate.addSeconds(timeoutInSeconds);
        claims.setExpirationTime(expirationDate);

        LOGGER.debug("Calculated ID token expiration claim to be [{}]", expirationDate);
    }
This is {@link OidcIdTokenGeneratorService}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/token/OidcIdTokenGeneratorService.java