Facebook profile pic coming up as Http: on secure website expected Https:

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 14:46:55

问题


On my Drupal 7 Website when users login with Facebook it pulls an insecure image

http:// profile.ak.fbcdn.net/hprofile-ak-ash3/211260_100002498550684_1807914074_s.jpg

I am using Drupal For Facebook

I've followed instructions here

Facebook JavaScript SDK over HTTPS loading non-secure items

Maybe it is outdated, what is the current fix for this?

Also oddly, When I login with my Facebook account it does not have the problem

https:// fbcdn-profile-a.akamaihd.net/hprofile-ak-ash4/211648_100004825298386_474362609_s.jpg

How do I make the profile pics secure no matter what? Thank your for your time.


回答1:


You can easily have the Graph API return the SSL URL for a user picture by appending the parameter return_ssl_resources=1 – see Mark’s picture, requested in the secure version:

https://graph.facebook.com/4/picture?return_ssl_resources=1




回答2:


So upon further review I came to realize that my Facebook profile was the only one having problems on my website with my profile picture staying unsecured after logging in with Facebook.

Upon digging deeper I realized when I logged into www.facebook.com directly my connection was by default unsecured as well.

I went into Account Setting and the Security tab and it said something about Secure browsing being in migration. I changed Secure Browsing to enabled and voila!

Everything is working perfectly.

I'm still wanting to implement this

str_replace('http://profile.ak.fbcdn.net','https://fbcdn-profile-a.akamaihd.net',$user['pic_square']);

So just in case someone it stuck in old school unsecured browsing it replaces the link but I don't even know how to do this or where the code goes but I will save that for another day.



来源:https://stackoverflow.com/questions/15423476/facebook-profile-pic-coming-up-as-http-on-secure-website-expected-https

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!