HWIOAuthBundle - Symfony2 - 从Facebook获取用户数据

Ang*_*edi 5 facebook facebook-graph-api symfony fosuserbundle hwioauthbundle

如何从Facebook Connect获取正确的用户数据,如配置文件图片(当前返回null),名字和姓氏(似乎现在只是实现全名)?

stl*_*oyd 11

总的来说,它非常简单,只需要进行一些调整config.yml:

hwi_oauth:
    firewall_name:         secured_area
    resource_owners:
        facebook:
            type:          facebook
            client_id:     <client_id>
            client_secret: <client_secret>
            infos_url:     "https://graph.facebook.com/me?fields=username,name,picture.type(square)"
            paths:
                profilepicture: picture.data.url
Run Code Online (Sandbox Code Playgroud)

更多细节可以在文档中找到.