Symfony 2 receiving anonymous token after basic authentication -


i have symfony 2 app using basic in_memory authentication (as described in security documentation). login works fine in our development environment(s). on staging server, basic authentication doesn't seem provide proper token -as seen in hereby provided logfile-; keep on getting login popup again , again.

our security configuration:

security:     firewalls:         secured_area:             pattern:    ^/             anonymous: ~             http_basic:                 realm: "secured demo area"      access_control:         - { path: ^/admin, roles: [role_admin]}      providers:         in_memory:             users:                 admin: { password: admin, roles: 'role_admin' }      encoders:         symfony\component\security\core\user\user: plaintext 

this log output (successful) development environment login:

[2011-07-21 13:49:48] security.debug: read securitycontext session [] [] [2011-07-21 13:49:48] security.debug: reloading user user provider. [] [] [2011-07-21 13:49:48] security.debug: username "root" reloaded user provider. [] [] 

and log output staging environment login:

[2011-07-21 13:53:08] security.info: populated securitycontext anonymous token [] [] [2011-07-21 13:53:08] security.debug: access denied (user not authenticated); redirecting authentication entry point [] [] [2011-07-21 13:53:08] security.debug: calling authentication entry point [] [] 

thanks in advance help.

your dev environment running php mod_php while staging server running fastcgi. default, php_auth_user , php_auth_pw server variables not filled in context when authenticate via http basic, , these symfony using create security context , validate password.

if you're running fcgi on apache can fix this. 1 force fastcgi pass authorization header, suppresses. add apache site definition next other fastcgi configuration options:

fcgidpassheader     authorization 

for other applications may need mess around greater degree (as described here) symfony passing header should sufficient.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -