Trả lời

11

Trong tổng thể nó là khá dễ dàng và đòi hỏi chỉ một số điều chỉnh trong 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 

Thông tin chi tiết có thể được tìm thấy trong documentation.

+0

và cách truy cập dữ liệu (ảnh) trong mã? (ví dụ trong bộ điều khiển) – pleerock

+0

okay, tôi hiểu rồi. Tôi phải làm một cái gì đó như thế này: '$ this-> getResourceOwnerByName ('facebook') -> getUserInformation ($ this-> get ('security.context') -> getToken() -> getRawToken()) -> getResponse () ' – pleerock

+0

@pleerock Bạn sử dụng tên đường dẫn: $ response-> getProfilePicture(); – Jonathan

Các vấn đề liên quan