cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution
1stwdco
New

Authorization headers not working (WordPress)

I use Wordpress Version 5.6

I am trying to pass authorization header in important plugin

 

My .htaccess already have :

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

 please advice as it is working on my wamp-localhost server

Note: Chat technical support is not cooperative at all

 

Amr Herz
1 ACCEPTED SOLUTION
SporadicThought
Helper I

Since no one has an answer. I'll take a stab at it.

It is likely your wamp server passes PHP differently than the GoDaddy server. They both utilize Apache servers, but PHP may be handled differently.

Check the last comment on this post:

https://stackoverflow.com/questions/4947548/what-does-this-this-http-authorization-rewriterule-do

[quote]

Symfony developers Group has a good answer for it. I quote:

it looks like your hosting is running php as a fcgi, not a php5_module, like your localhost does. ( phpinfo - Server API: CGI/FastCGI )

the point is that php5_module automatically handles HTTP_AUTHORIZATION headers, but fcgi_module does not.

solution is simple - add this line to your .htacces on your hosting server:

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

It worked for me

[/quote]

I hope that can at least point you in the right direction.

Dr. B

View solution in original post

1 REPLY 1
SporadicThought
Helper I

Since no one has an answer. I'll take a stab at it.

It is likely your wamp server passes PHP differently than the GoDaddy server. They both utilize Apache servers, but PHP may be handled differently.

Check the last comment on this post:

https://stackoverflow.com/questions/4947548/what-does-this-this-http-authorization-rewriterule-do

[quote]

Symfony developers Group has a good answer for it. I quote:

it looks like your hosting is running php as a fcgi, not a php5_module, like your localhost does. ( phpinfo - Server API: CGI/FastCGI )

the point is that php5_module automatically handles HTTP_AUTHORIZATION headers, but fcgi_module does not.

solution is simple - add this line to your .htacces on your hosting server:

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

It worked for me

[/quote]

I hope that can at least point you in the right direction.

Dr. B

View solution in original post