I am trying to make an API request from postman to WordPress.

I get a 401 Authorization required error when I make the call, as per the screenshot below:

enter image description here

The credentials I am using are from the admin user of the site. I want to use OAuth in the future, but for testing purposes, I am trying to run a simple test with basic authentication, and move for OAuth afterward.

I do not understand if I am missing some WordPress configuration, or what is wrong here.

I have WordPress 4.9.5.
I have tried going to the user details/ settings/profile to search for the API keys for the user, as per some information I found online, but I see no API related information in the admin user or other.
I have tried making changes to the .htaccess file to add a line related to the Authorization, but I haven’t been able to get this to work.

I am running out of options as I can’t understand what I am missing…Any hints?

2 Answers
2

adding this rule to .htaccess solved my problem: –

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *