composer require hwi/oauth-bundle
If you use a recent version of Symfony supporting Symfony Flex, when prompted, accept to execute the recipes coming from the contrib repository. You'll see an error at the end of the process, it's intended. Continue straight to the second step: configuring resource owners (Facebook, GitHub, Google, Windows Live and others to fix it.
If you use an old version of Symfony, follow the instructions provided in the next sections.
Enable the bundle in the kernel:
// src/Kernel.php
public function registerBundles()
{
$bundles = [
// ...
new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
];
}
Import the redirect.php
and login.php
routing files in your own routing file.
# config/routing.yaml
hwi_oauth_redirect:
resource: "@HWIOAuthBundle/Resources/config/routing/redirect.php"
prefix: /connect
hwi_oauth_connect:
resource: "@HWIOAuthBundle/Resources/config/routing/connect.php"
prefix: /connect
hwi_oauth_login:
resource: "@HWIOAuthBundle/Resources/config/routing/login.php"
prefix: /login
Note:
To prevent strange issues, this route should be imported before your custom ones.
When you're done. Continue by configuring the resource owners you want to use in your application!
Step 2: Configuring resource owners (Facebook, GitHub, Google, Windows Live and others