0

I'm just wondering if it's possible to have different entities for different user types that can login with the security component? So far what i can see is i can set the user provider entity in security.yaml which all works fine, and logs in no problem.

But i have 4 different user types which i don't want to manage just via roles because they all have different fields in the database. So is it possible to use multiple entities in the security class and perhaps multiple check paths for each one?

So i may have ROLE_CUSTOMER that logs in via 1 form on the UserCustomer entity which implements the user interface, and a user ROLE_ADMIN that uses UserAdmin entity and logs in via a different route?

Glen Elkins
  • 867
  • 9
  • 30
  • 1
    It is possible to have different user class implementing userinterface, it is also possible to have different userProvider with different different login route... lokk at this, it's old but you could finc something useful : https://stackoverflow.com/questions/15366637/symfony-firewalls-multiple-login-forms – Yoann MIR Mar 13 '19 at 16:00
  • Thanks that’s helpful! – Glen Elkins Mar 14 '19 at 20:40

0 Answers0