private void processAttributes(final AttributeMap attributeMap,
                                   final Optional<UserIdentity> optUserIdentity) {
        if (attributeMap != null) {
            // Add the user identified in the token (if present) to the attribute map.
            // Use both ID and username as the ID will likely be a nasty UUID while the
            // username will be more useful for a human to read.
            // Set them to null if we have no identity to prevent clients from setting these
            // headers themselves.
            final String uploadUserId = optUserIdentity.map(UserIdentity::getSubjectId)
                    .filter(NullSafe::isNonBlankString)
                    .orElse(null);
            final String uploadUsername = optUserIdentity.map(UserIdentity::getDisplayName)
                    .filter(NullSafe::isNonBlankString)
                    .orElse(null);

            attributeMap.put(StandardHeaderArguments.UPLOAD_USER_ID, uploadUserId);
            attributeMap.put(StandardHeaderArguments.UPLOAD_USERNAME, uploadUsername);

            // Remove authorization header from attributes as it should not be stored or
            // forwarded on.
            NullSafe.consume(attributeMap, userIdentityFactory::removeAuthEntries);
        }
    }
Create a combined filter that takes into account the currently configured
auth mechanisms

@param configState
@return
stroom-receive/stroom-receive-common/src/main/java/stroom/receive/common/RequestAuthenticatorImpl.java