skip to Main Content

WordPress Rest API Basic Authentication with HTTP Authorization

PHP HTTP AUTHORIZATION HEADER ENABLE

Minimum PHP version: 5.3.0+
Most of the shared hosting has disabled the HTTP Authorization Header by default.

To enable this option you’ll need to edit your .htaccess file adding the following

RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]

WPENGINE

To enable this option you’ll need to edit your .htaccess file adding the following

See https://github.com/Tmeister/wp-api-jwt-auth/issues/1

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

Additional Resources

JWT Authentication for WP REST API

https://github.com/WP-API/WP-API




Back To Top