You mean you have 2 WordPress installations and from installation 1 you want to be able to authenticate to installation 2?
I’m running WordPress and an automation tool side by side (Node-RED or OL Connect Workflow). The automation tool fetches a bearer key in order to create and update (custom) posts via custom end points. This works like a charm when running everything on the same box. We use this setup in various on-premise solutions.
I’m currently moving this setup to run on containers to simplify deployment in the cloud. This is where I ran into the CORS challenge.
If you can write down what you exactly need from this plugin to make it work for your situation, I can look if this improves the plugin and if I can implement it.
Alright, let me work on that.
Hi Michiel,
I did some debugging and traced things down to the rest_authentication_errors_filter function. The problem in my setup is related to the fact that the host in $currentUrl differs from the $siteUrl. This is caused by the fact that I’m contacting the end points in WordPress from a separate container. This causes the preg_match to return an error resulting in an 401 error in the client in my other container.
Initally I thought that I could workaround this by setting the Access-Control-Allow-Origin header but I couldn’t get that to work.
Hope this is of some help.