Missing Authorization header using JWT Missing Authorization header using JWT php php

Missing Authorization header using JWT


Ok, i just found the answer here: https://devhacksandgoodies.wordpress.com/2014/06/27/apache-pass-authorization-header-to-phps-_serverhttp_authorization/

So i added the following line to my htaccess file and it fixed my issue:

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


If you use Mamp PRO I found out that you can just add lines in their config editor:enter image description here


I just had this problem (same plugin!), and solved it by editing the validation function:

// in public/class-jwt-auth-plugin.php// Check for auth in raw headers without $_SERVER variable (Apache Server).if ( !$auth && function_exists('getallheaders') ) {     $headers = getallheaders();     $auth = isset($headers['Authorization'])     ? $headers['Authorization'] : false;}

Although I'm not a PHP expert, I don't see why this code can't be included in the plugin to start with.