tuupola/slim-basic-auth

Can't get Authorization header using fastCGI

filipefreitas82 opened this issue · 1 comments

This isn't really an issue, I just can't use this workaround:
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -host 127.0.0.1:9000 -pass-header Authorization

I was trying to use the environment option:
"environment" => "REDIRECT_HTTP_AUTHORIZATION"

but this is not implemented for slim v3. Any special reason?

The 3.x branch removed all the workarounds and assumes user has an environment which correctly includes the Authorization header in the the PSR-7 request object. If a workaround is required it is assumed not to be this middlewares responsibility anymore.

If headers cannot be fixed with web server or framework config, you could create an ad-hoc middleware which inserts the correct Authorizationheader before calling this middleware. You could also use the older 2.x branch which still has the workarounds and also supports Slim 3.

UPGRADING describes the differences between 2.x and 3.x in more depth.