FriendsOfSymfony/FOSUserBundle — Issue #466: Is there any possibility to use FOSUser for few different Entity/firewalls?
Author: unrealevil
Created: 2011-12-28 08:34:18+00:00
State: open

To my mind, it's good idea to connect diferent Entities to each firewall. It's necessary when you have separate frontend and backend users. For example, frontend users are located in table fos_user, but backend users - in table admin_user. Possible configuration:

fos_user:
main:
db_driver: orm
firewall_name: main
user_class: App\UserBundle\Entity\User
admin:
db_driver: orm
firewall_name: admin
user_class: App\AdminBundle\Entity\Admin

security:
firewalls:
admin:
pattern: /admin(.*)
form_login:
provider: fos_userbundle
main:
pattern: ^/
form_login:
provider: fos_userbundle