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]


On Friday, 16 March 2012 22:22:05 UTC+1, Vojtěch Drbohlav wrote:
>
> Hi,
>
> I am trying to use HTTP Basic Authentication with Symfony 2. It works fine 
> on localhost but it doesn't work when I upload it on my hosting. When I try 
> to login it always returns error "401 A Token was not found in the 
> SecurityContext." and requests username and password again and again.
>
> Here is my firewall setting from security.yml:
>         app:        
>             pattern: ^/app
>             anonymous: false
>             http_basic:
>                 realm: "Meta Edu Studio API"
>             logout:
>                 path: /app/logout
>                 target: /
>
> Does anyone have idea what could be wrong?
>
> Thank you in advance,
> vojta
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to