Tmeister / wp-api-jwt-auth

A simple plugin to add JSON Web Token (JWT) Authentication to WP REST API
GNU General Public License v2.0
549 stars 159 forks source link

Unable to configure for AWS Lightsail (bitnami) #215

Closed ketodiet closed 3 years ago

ketodiet commented 3 years ago

Hello,

i've been trying to configure the plugin and enable the authentication header as per configuration guide. Without the auth header the IsValidToken method always returns false.

Nothing I tried so far seems to work so I'm posting here in case anyone knows.

I tried adding the following sections in htaccess.conf but neither worked - any ideas?

<Directory "/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/jwt-authentication-for-wp-rest-api">
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
</Directory>
<Directory "/opt/bitnami/apps/wordpress/htdocs">
RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
</Directory>