0
votes

The Symfony2 Security documentation is pretty complex and not well documented.

I have a question regarding how to Authenticate a user from database. There is no good example as to how to Authenticate using simple username and password from database table.

My question is, in order to Authenticate should I 1) Implement the UserProviderInterface interface and call function loadUserByUsername 2) If user found return the User Object 3) Check if form submitted password and the User object password match

Is this correct?

Please advise

1

1 Answers

4
votes

While I agree it is a little complex, everything you need is documented and not too hard to find with a little research, hopefully the following helps you out:

Check out the FOSUserBundle if you want to store users via Doctrine ORM, MongoDB/CouchDB ODM or Propel.

If you want to entirely build your own user provider follow this guide.