Can't authenticate with basic authentication using WP REST API 2.0 plugin

后端 未结 3 1895
无人共我
无人共我 2020-12-19 08:42

I\'m having an issue with basic authentication.

Trying to send a GET request with Postman (chrome plugin) using the following url: http://_MY_WEBSITE_URL_/w

3条回答
  •  梦毁少年i
    2020-12-19 09:22

    Finally, I figured out the solution. I had to add some new options manually to my .htaccess file, the plugin didn't make it.

    The code:

    # BEGIN WP BASIC Auth
    
    RewriteEngine On
    RewriteBase /PluginTest/
    RewriteCond %{HTTP:Authorization} ^(.*)
    RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
    
    # END WP BASIC Auth
    

提交回复
热议问题