I use symfony sfDoctrineGuardPlugin to manage authentication for both frontend users and backend users. It's fine, except that I don't want frontend users to be able to login to the backend app. I can setup credentials, but credentials are checked after a user gets authenticated. What I want is to have sigin in form to never validate for a user, that is not in a backend group. How can I do this?
相关问题
- Symfony form values missing
- Functional Test - Mock service does not persist in
- Doctrine 2.5: Unrecognized field (but only in Symf
- Symfony2 Doctrine entity not hydrated
- How to order by multiple columns with propel
相关文章
- Symfony ONE-TO-ONE relation
- Doctrine 2 PlainValue expected
- Symfony 1.4 sessions randomly lost
- How to internationalize metas such as title in vie
- ManyToOne association mapping to a Class Table Inh
- How to debug symfony in Netbeans? I cannot call sp
- Migrating Existing Users and Passwords to new Symf
- Doctrine Dbal: How to set collation? (in Symfony2)
I think I found a better solution. sfDoctrineGuard plugin has its own post validator that checks for an optional callable for user retrival.
I think you just have to add:
at the end of your
backend/config/factories.yml
By default, symfony shares session cookies, with this solution, symfony separate this cookies.Here's one idea: You could try creating a custom post-validator for the login form. Here's a Google result:
http://www.symfony-project.org/blog/2008/09/05/call-the-expert-how-to-implement-a-conditional-validator
In this validator, you could check whether the user belongs to the group in question and then throw an error accordingly. The user would not get authenticated.