1

I can't get profile photo. Any Ideas?

# Some part from config.yml

hwi_oauth:
    firewall_names: [secured_area]
    resource_owners:
        vkontakte:
            type:                vkontakte
            client_id:           <client_id>
            client_secret:       <client_secret>
            scope:               "photo_50,email"

...

I get all other standard parameters when I log to the site with vk button. Such as: first_name, last_name, email, vk id etc. A field "photo_50" => NULL Response Screenshot Response Screenshot

Community
  • 1
  • 1
chrisperk
  • 47
  • 8
  • When I comment out 'scope' parameter in config.yml, result stay as image above. – chrisperk Dec 30 '16 at 09:09
  • I found solution. I corrected class "HWI\Bundle\OAuthBundle\OAuth\ResourceOwner\VkontakteResourceOwner.php". Edited "photo" to "photo_50". Who knows another good solution without hardcoding vendors files? – chrisperk Dec 30 '16 at 13:32

1 Answers1

0

You need this configuration in your app/config/config.yml:

hwi_oauth: resource_owners: vkontakte: type: vkontakte client_id: %id% client_secret: %secret% scope: "email" paths: profilepicture: response.0.photo_big options: fields: "photo_big"

Stephan Yamilov
  • 605
  • 7
  • 14