Skip to content
Branch: master
Find file Copy path
Find file Copy path
9 contributors

Users who have contributed to this file

@stloyd @XWB @asm89 @soullivaneuh @stof @mathieu-gilloots @franmomu @eduardoconceicao @4ssil
64 lines (45 sloc) 1.94 KB

Step 1: Setting up the bundle

A) Add HWIOAuthBundle to your project

composer require hwi/oauth-bundle php-http/guzzle6-adapter php-http/httplug-bundle

Why php-http/guzzle6-adapter? We are decoupled from any HTTP messaging client thanks to HTTPlug.

Why php-http/httplug-bundle? This is the official Symfony integration of HTTPlug. This makes it possible to provide the required HTTP client and message factory with ease. The dependency is optional but you will have to provide your own services if you don't set it up.

B) Enable the bundle

Enable the bundle in the kernel:

// app/AppKernel.php

public function registerBundles()
    $bundles = array(
        // ...
        new Http\HttplugBundle\HttplugBundle(), // If you require the php-http/httplug-bundle package.
        new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),

If you don't use HttplugBundle, you will have to configure your own client service.

C) Import the routing

Import the redirect.xml and login.xml routing files in your own routing file.

# app/config/routing.yml
    resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
    prefix:   /connect

    resource: "@HWIOAuthBundle/Resources/config/routing/connect.xml"
    prefix:   /connect

    resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
    prefix:   /login


To prevent strange issues, this route should be imported before your custom ones.

Continue to the next step!

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

You can’t perform that action at this time.