HWIOAuthBundle - Symfony2 - 从 Facebook 获取电子邮件

HWIOAuthBundle - Symfony2 - Get email from Facebook

我在 Symfony2 项目中使用 HWIOAuthBundle

如何从 Facebook 获取用户电子邮件,我关注了 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

而 var_dump 的结果总是 returns null

这是由于未验证的电子邮件地址,批准权限后查看您的电子邮件,并尝试使用其他帐户。