Search code examples
symfonyhwioauthbundle

The child node "firewall_name" at path "hwi_oauth" must be configured


I'm doing a project with Symfony2 and I want to use Google/Facebook/Twitter for connection. So I installed HWIOAuthBundle, but I got this error when I update my composer.json

"The child node "firewall_name" at path "hwi_oauth" must be configured.".

Thanks for you help !


Solution

  • Yes, and if you read the doc :

    (it gives the config... )

    Step 2: Configuring resource owners

    HWIOAuthBundle creates a dedicated service for each resource owner you want to use in your application. These resource owners will be used in the oauth firewall. The bundle ships several pre-configured resource owners that need only a little configuration.

    To make this bundle work you need to add the following to your app/config/config.yml:

    app/config/config.yml

    hwi_oauth:
        # name of the firewall in which this bundle is active, this setting MUST be set
        firewall_name: secured_area
    
        # an optional setting to configure a query string parameter which can be used to redirect
        # the user after authentication, e.g. /connect/facebook?_destination=/my/destination will
        # redirect the user to /my/destination after facebook authenticates them.  If this is not
        # set then the user will be redirected to the original resource that they requested, or
        # the base address if no resource was requested.  This is similar to the behaviour of
        # [target_path_parameter for form login](http://symfony.com/doc/2.0/cookbook/security/form_login.html).
        # target_path_parameter: _destination