protected ProxyGrantingTicket produceTicketWithAdequateExpirationPolicy(
        final RegisteredServiceProxyGrantingTicketExpirationPolicy servicePgtPolicy,
        final ProxyGrantingTicketIssuerTicket serviceTicket,
        final Authentication authentication,
        final String pgtId) {
        if (servicePgtPolicy != null) {
            LOGGER.trace("Overriding proxy-granting ticket policy with the specific policy: [{}]", servicePgtPolicy);
            return serviceTicket.grantProxyGrantingTicket(pgtId, authentication,
                new HardTimeoutExpirationPolicy(servicePgtPolicy.getMaxTimeToLiveInSeconds()));
        }
        LOGGER.trace("Using default ticket-granting ticket policy for proxy-granting ticket");
        return serviceTicket.grantProxyGrantingTicket(pgtId, authentication,
            this.expirationPolicyBuilder.buildTicketExpirationPolicy());

    }
The {@link DefaultProxyGrantingTicketFactory} is responsible
for creating {@link ProxyGrantingTicket} objects.

@author Misagh Moayyed
@since 4.2
core/cas-server-core-tickets-api/src/main/java/org/apereo/cas/ticket/factory/DefaultProxyGrantingTicketFactory.java