Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3619

WP REST API and "Only authenticated users can access the REST API"

$
0
0

I have a WordPress: https://example.comI need to use WP REST API.

In .htaccess:

# BEGIN WordPress<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase /RewriteRule ^index\.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]RewriteCond %{HTTP:Authorization} ^(.*)RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]</IfModule># END WordPress

I use theBasic-Auth plugin on my WordPress: https://github.com/WP-API/Basic-Auth

Nevertheless I have:

{"code": "rest_cannot_access","message": "Only authenticated users can access the REST API.","data": {"status": 401    }}

enter image description here

I tested with http and https.

What's wrong?


Viewing all articles
Browse latest Browse all 3619

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>