Hey everyone.
Firstly, great work @jan on making such an incredible project. Really pumped about the series A funding and what will be coming with it. Congratulations on it!
Getting to the point of the topic, I was trying to connect my WC stores to n8n, and it always worked seamlessly (On single site installations). That is until I tried to connect n8n to a WC subsite in my multi-site network.
I saw this thread in the community, however before trying this solution (as it involves changing .htaccess, which shouldn’t be necessary, as the api works with other services, like Insomnia), I was wondering if the multi-site installation, or my configuration settings (I am using subdomains) could be related to this. To test this hypothesis, I tried to connect to another multisite installation for testing purposes that has subdirectories installation enabled, instead of subdomain, and the error still persists.
This leads me to believe the problem is related to Multi-site wordpress, which is not properly adapted to the n8n node.
Because the nature of the solution involves changing .htaccess, by itself a very sensitive file, and because I am running Multi-site, which brings changes to the default .htaccess file, I think the best solution, for long term purposes is working the bug out in the n8n side.
Hopefully this can be sorted out without the need to change WP installation, as it shouldn’t be, and because of the intricacies it involves, making it not a User friendly solution.
This seems to be an issue on the WordCommerce side rather than the n8n side. Check issue #4 in the link below. They recommend using OAuth1.0 instead of Basic authentication, which is what the node currently uses.
This might also be related. I can add an option in the credentials to decide whether to send the credentials in the header or the query string.
Occasionally, some servers may not parse the Authorization header correctly (if you see a “Consumer key is missing” error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters instead.
The post below gives you instructions to test it locally. The only difference it’s that you have to use the branch name feature/woocommerce-extended instead of fix/mailjet-node.
If it was not working before, it should not be working now (With the query string set to false) as I did not touch the “old” part. The only thing that I did was send the credentials in the query string IF the variable Include Credentials in Query is set to true.
If you try with your old instance, does it error? Did you change anything on your server?
The endpoint and credentials are the same, on the left with the production n8n server, to the right the one you made the changes. I was actually mistaken, seems like if the
is not enabled it does not work, like expected. I did not change anything on my server, so seems like it was just a mistake on my part.
Thanks a lot @Bruno_Tome ! Is really appreciated! Great to have people like you in the community who are so excited about n8n.
Thanks for confirming that this change is actually necessary. Just released a new n8n version a few hours ago but because it was not clear if the change was necessary did I not merge it yet. Will then be released with the version next week.