I'm using FOSUserBundle to authenticate users from database and now I want add authentication through oAuth services(like Facebook, Twitter and others). How to do this in best way?
I found this bundle https://github.com/hwi/HWIOAuthBundle/ It should solve my problem.
Have a look at the FOS Facebook bundle: https://github.com/FriendsOfSymfony/FOSFacebookBundle
They already solved your problem :)
There are many solutions for OAuth in Symfony2:
As a client (to authenticate with Facebook, Twitter or Google):
FOSFacebookBundle, FOSTwitterBundle or HWIOAuthBundle
I highly recommend HWIOAuthBundle (https://github.com/hwi/HWIOAuthBundle/), if you're looking for oAuth authenthication only.
And there is a solution for OAuth server:
FOSOAuthServerBundle (https://github.com/FriendsOfSymfony/FOSOAuthServerBundle/).