@Override
    protected String[] createResource(final Object[] args) {
        val results = new LinkedHashMap<>();
        Arrays.stream(args).forEach(arg -> {
            if (arg instanceof final HttpServletRequest request) {
                results.put(CasProtocolConstants.PARAMETER_RENEW,
                    StringUtils.defaultIfBlank(request.getParameter(CasProtocolConstants.PARAMETER_RENEW), "false"));
                results.put(CasProtocolConstants.PARAMETER_GATEWAY,
                    StringUtils.defaultIfBlank(request.getParameter(CasProtocolConstants.PARAMETER_GATEWAY), "false"));
            }
            if (arg instanceof final Assertion assertion) {
                val authn = assertion.getPrimaryAuthentication();
                results.put("principal", authn.getPrincipal().getId());
                results.put("service", DigestUtils.abbreviate(assertion.getService().getId(),
                    casProperties.getAudit().getEngine().getAbbreviationLength()));
                if (casProperties.getAudit().getEngine().isIncludeValidationAssertion()) {
                    val attributes = new HashMap<String, Object>(authn.getAttributes());
                    attributes.putAll(authn.getPrincipal().getAttributes());
                    results.put("attributes", attributes);
                }
            }
        });
        return results.isEmpty()
            ? ArrayUtils.EMPTY_STRING_ARRAY
            : new String[]{auditFormat.serialize(results)};
    }
This is {@link ProtocolSpecificationValidationAuditResourceResolver}.

@author Misagh Moayyed
@since 6.4.0
core/cas-server-core-audit-api/src/main/java/org/apereo/cas/audit/spi/resource/ProtocolSpecificationValidationAuditResourceResolver.java