protected String[] getPrincipalIdFromSamlEcpResponse(final Envelope envelope) {
        val objects = envelope.getBody().getUnknownXMLObjects();
        if (objects.isEmpty()) {
            return ArrayUtils.EMPTY_STRING_ARRAY;
        }
        val object = objects.getFirst();
        if (object instanceof final Response response) {
            return getPrincipalIdFromSamlResponse(response);
        }
        if (object instanceof final Fault fault) {
            return getPrincipalIdFromSamlEcpFault(fault);
        }
        return ArrayUtils.EMPTY_STRING_ARRAY;
    }
This is {@link SamlResponseAuditResourceResolver}.

@author Misagh Moayyed
@since 5.3.0
support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/audit/SamlResponseAuditResourceResolver.java