facebooksymfonyfacebook-graph-apihwioauthbundle

HWIOAuthBundle - Symfony2 - Get email from Facebook


I am using HWIOAuthBundle in a Symfony2 project

How can i get the User email from Facebook, i followed the documentation , it asks me only the first time for permissions although i configured it to rerequest them. See also this issue

hwi_oauth:
http_client:
    timeout: 19
    verify_peer: false
    ignore_errors: false
    max_redirects: 1
firewall_names: [main]
resource_owners:
    facebook:
        type:          facebook
        client_id:     xxxxxxx  
        client_secret: xxxxxxxxxxxxxxxxx
        scope:         "email"
        infos_url:     "https://graph.facebook.com/me?fields=id,name,email,picture.type(square)"
        paths:
            email:     email
            profilepicture: picture.data.url
        options:
            display:    'popup'
            auth_type: rerequest #  Re-asking for Declined Permissions

And the result of var_dump always returns null


Solution

  • This is because of the unverified email address, Check out your email after approving the permission, and try with another account.