@Override
    public String getPrincipalIdFrom(final JoinPoint auditTarget, final Authentication authentication,
                                     final Object resultValue, final Exception exception) {
        if (resultValue instanceof final AccountRegistrationRequest request) {
            return request.getUsername();
        }
        val context = RequestContextHolder.getRequestContext();
        return AccountRegistrationUtils.getAccountRegistrationRequestUsername(context);
    }
This is {@link AccountRegistrationRequestAuditPrincipalIdResolver}.

@author Misagh Moayyed
@since 6.5.0
support/cas-server-support-account-mgmt/src/main/java/org/apereo/cas/acct/AccountRegistrationRequestAuditPrincipalIdResolver.java