Symfony 3 authentication and authorization

176 Views Asked by At

I'm building a site on top of latest Symfony framework (v3.3). I have no limitation on what packages to use. The authentication/authorization mechanism will get complicated over time; currently it has the following requirements:

  1. In-memory authentication for the "root" user
  2. On top of the "root" authentication, one of:
    • Local database user/pass authentication
    • LDAP authentication
    • Azure Active Directory (graph-api)

Regarding authorization,

  • There are four levels: ROOT, ADMIN, USER, ANONYMOUS
  • In case of USERS, we need to have a set of security groups that regulate what parts of data is accessible (ie. HARDWARE, SOFTWARE, ACCESSORIES).

So, the question is:

Does Symfony 3 provide a easy solution of such setup out of the box? (ie. using LdapUserProvider)

If the answer do the above question is "NO", I'm contemplate using FOSUserBundle and FR3DLdapBundle. As of mid 2017, will this decision complicate my life in long term or will it simplify it?

1

There are 1 best solutions below

0
Leszek On

You can use FOS User Bundle. This Bundle is:

  • easy to set up,
  • is well known in community (which is important when you meet some issues)
  • highly configurable, which allows you to set up authorization with LDAP