Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a facebook profile picture under https?

Is it possible to get an facebook profile picture under https using the new Graph API?

We run a site under https, but the profile picture returned by the facebook Graph API is always served as http (when using https://graph.facebook.com/XXX/picture, the request is redirects to http:// ...). The result is the dreaded mixed-content message.

Anybody know of a workaround?

like image 509
user357991 Avatar asked Jul 07 '10 21:07

user357991


People also ask

How do I enable my profile picture Guard 2022?

In the right menu column, click FACEBOOK TOOLS and select Avatar Guard to activate Facebook profile picture guard function. Switch to the new page, click the Enable Profile Picture Guard button. Wait a few seconds for the success message to appear. Then go to your personal page to see if the shield is enabled.


2 Answers

Here is the fix: you need to the parameter: return_ssl_resources=true

example:

https://graph.facebook.com/FB_UID/picture?return_ssl_resources=true

like image 60
Nicolo77 Avatar answered Sep 21 '22 20:09

Nicolo77


Use link 1 to get a high resolution image, link 2 to get an icon sized image where 'xxxx' refer to 'facebook_user_id'.

  • link 1 : https://graph.facebook.com/xxxx/picture?type=large
  • link 2 : https://graph.facebook.com/xxxx/picture?type=small
like image 37
Vihanga Yasith Avatar answered Sep 25 '22 20:09

Vihanga Yasith