WP-API / Basic-Auth

Basic Authentication handler for the JSON API, used for development and debugging purposes
772 stars 286 forks source link

Basic Auth not working for curl #24

Open axaeo opened 9 years ago

axaeo commented 9 years ago

I'm trying to retrieve custom fields from a post on our website - we have REST API configured, and I understand that to retrieve custom fields with REST, we have to access the page in edit mode. However, the following curl request:

curl -u "myuserid:mypassword" http://www.mywebsite.com/wp-json/posts/67?context=edit

Consistently returns the following, even though I have the Basic Auth plugin installed:

[{"code":"json_cannot_edit","message":"Sorry, you cannot edit this post"}]

The request works fine if I don't include ?context=edit. I'm not sure how to proceed in debugging this. (For further context, we're also using Advanced Custom Fields - I'm not sure if this affects our ability to use this plugin or not.