Skip to content

Instantly share code, notes, and snippets.

@danvbe
Last active July 23, 2025 05:56
Show Gist options
  • Select an option

  • Save danvbe/86b96b1c63a8668dddeb33c28dc20def to your computer and use it in GitHub Desktop.

Select an option

Save danvbe/86b96b1c63a8668dddeb33c28dc20def to your computer and use it in GitHub Desktop.
A (newer) way to integrate FosUserBundle and HWIOAuthBundle - Using Symfony 3.4 with Flex
### ....... ###
###> hwi/oauth-bundle ###
FB_ID=<your fb app id>
FB_SECRET=<your fb app secret>
GH_ID=<your github app id>
GH_SECRET=<your github app secret>
###< hwi/oauth-bundle ###

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:

  1. .env file - here we will store the AppId and Secret for FB and Github (and any other providers you may use)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment