symfony - Symfony2 - Access control -


I want to set access_control for everything but pattern / login < / Code> (and maybe some more root).

So I set the path for the first time with the path IS_AUTHENTICATED_ANONYMOUSLY . Then I set the path for everything with the IS_AUTHENTICATED_FULLY role.

The problem is that the login form is now generated twice, I see two login fields, submit two buttons, and so on.

If I remove access_control rules, I do not have it, and only with / blog /.* and role: IS_AUTHENTICATED_FULLY , this is fine Works, login form should be such.

Therefore, "I need to authenticate everywhere except " is not working.

What I tried to do to do this, when the login form is generated twice:

  access_control: - {path: / login, role: IS_AUTHTHICATED_ANONYMOUSLY} - {Path: /.*, Role: IS_AUTHENTICATED_FULLY}   

Is there any good example for establishing such a rule?

I've got the answer :) So if anyone should have this problem, you should also _wdt , And _profiler are to be transmitted anonymously :)

 access_control: - {path: /_wdt/.*, role: IS_AUTHENTICATED_ANONYMOUSLY} - {path: /_profiler/.*, role: IS_AUTHENTICATED_ANONYMOUSLY} - {Path: / login, role: IS_AUTHENTICATED_ANONYMOUSLY} - {path: /.*, role: IS_AUTHENTICATED_FULLY}   

Comments