0

After to go to http://localhost/app_dev.php/login/facebook I have this error :

 [1/2] RequestException: Failed to connect to localhost port 1080: Connection refused  -

in vendor/kriswallsmith/buzz/lib/Buzz/Client/Curl.php at line 29

Uncaught PHP Exception HWI\Bundle\OAuthBundle\OAuth\Exception\HttpTransportException: "Error while sending HTTP request" at /var/www/symfony/vendor/hwi/oauth-bundle/OAuth/ResourceOwner/AbstractResourceOwner.php line 256 Context: { "exception": "Object(HWI\\Bundle\\OAuthBundle\\OAuth\\Exception\\HttpTransportException)" } 

My config_dev.php :

# HWIOAuthBundle
hwi_oauth:
    connect:
        account_connector: hwi_oauth.user.provider.entity
    firewall_names: [secured_area]
    resource_owners:
        facebook:
            type:                facebook
            client_id:           ...
            client_secret:       ...
            options:
                display: popup #dialog is optimized for popup window
                auth_type: rerequest 
    fosub:
        username_iterations: 30
        properties:
        facebook: facebookId

My security.yml : ...

    providers:
        fos_userbundle:
            id: fos_user.user_provider.username

    firewalls:
        secured_area:
            anonymous: ~
            oauth:
                resource_owners:
                    facebook: "/login/check-facebook"
                login_path:        /login
                failure_path:      /login

                oauth_user_provider:
                    service: hwi_oauth.user.provider.entity

For information I use Symfony3.

Thanks for your help :)

k0pernikus
  • 60,309
  • 67
  • 216
  • 347
n1c01a5
  • 88
  • 9
  • When I look at [this site](https://github.com/hwi/HWIOAuthBundle), at the bottom section that shows Documentation, it says supported on Symfony less than 3.0. – Alvin Bunk Jun 17 '16 at 18:08

2 Answers2

0

In your app/config/routing.yml do you have:

facebook_login:
    path: /login/check-facebook

And in app/config/security.yml add this too:

access_control:
   - { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }

Check those please.

Alvin Bunk
  • 7,621
  • 3
  • 29
  • 45
0

Add this in your hwi_oauth in your config.yml file.

hwi_oauth:
      http_client:
          verify_peer: false
shuba.ivan
  • 3,824
  • 8
  • 49
  • 121