@Audit(
        action = AuditableActions.REST_API_SERVICE_TICKET,
        actionResolverName = AuditActionResolvers.REST_API_SERVICE_TICKET_ACTION_RESOLVER,
        resourceResolverName = AuditResourceResolvers.REST_API_SERVICE_TICKET_RESOURCE_RESOLVER)
    @Override
    public ResponseEntity<String> build(final String ticketGrantingTicket, final WebApplicationService service,
                                        final AuthenticationResult authenticationResult) throws Throwable {
        val factory = chain.stream()
            .filter(responseFactory -> responseFactory.supports(service, authenticationResult))
            .findFirst()
            .orElseThrow(() -> new IllegalArgumentException("Unable to locate a response entity factory to build a service ticket. "
                                                            + "This generally is due to a configuration issue where CAS is unable to recognize the incoming request"));
        return factory.build(ticketGrantingTicket, service, authenticationResult);
    }
This is {@link CompositeServiceTicketResourceEntityResponseFactory}.

@author Misagh Moayyed
@since 5.3.0
core/cas-server-core-rest-api/src/main/java/org/apereo/cas/rest/factory/CompositeServiceTicketResourceEntityResponseFactory.java