A while ago I have written a GIST on how to integrate these using Symfony 2.4. Some time have passsed and I needed to use them in a Symfony 3.4 (with Flex) ... and I had some hard times porting everything. So, in order to provide some help for you out there... here is the way I have done it:
First of all, I had some troubles installing HWIOAuthBundle. This is the solution that worked for me. On and on, you will NOT be able to install it without errors UNTIL you set up the propper configs for the bundle.
After everything was installed and running (I will not insist here on setting up FosUserBundle, as that is pretty easy and goes smoothly), we should start and setup all the proper settings.
In this demo I have used Facebook and GitHub, but you may add any other providers.
You will get some of the config automatically setup when installing bundles, but you need to focus on: