I am using the rest api in Wordpress. For authentication I use the Basic authentication plugin (JSON Basic Authentication)
I use this request (from both postman and nodejs):
POST /wp-json/wp/v2/posts HTTP/1.1
Host: **************
Authorization: Basic *********************
Content-Type: application/json
Cache-Control: no-cache
{ "title": "test", "content": "test", "status": "private", "excerpt": "test" }
When testing locally on my server, it works fine but on a VPS I get the following error:
{
"code": "rest_cannot_create",
"message": "Sorry, you are not allowed to create posts as this user",
"data": {
"status": 401
}
}
I know the user credentials are correct and the user is allowed to create posts.
I suspect that the auth header is lost somewhere before arriving to rest-api. But where should I start debugging? Which logs?