Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

user profile image url issue from the new graph API requirement #343

Closed
anklos opened this issue Sep 24, 2020 · 7 comments
Closed

user profile image url issue from the new graph API requirement #343

anklos opened this issue Sep 24, 2020 · 7 comments

Comments

@anklos
Copy link
Contributor

anklos commented Sep 24, 2020

Currently if I turn on facebook development mode, I find that all users' facebook profile image urls will redirect to the default empty facebook image.

Image urls that saved in my database are like: http://graph.facebook.com/v4.0/10207720064671302/picture. And it will redirect to an empty image url like https://scontent.fsyd3-1.fna.fbcdn.net/v/t1.30497-1/cp0/c15.0.50.50a/p50x50/84628273_176159830277856_972693363922829312_n.jpg?_nc_cat=1&_nc_sid=12b3be&_nc_ohc=hEY_R-t_S40AX_3EtD7&_nc_ht=scontent.fsyd3-1.fna&_nc_tp=27&oh=44a6979759bc9e99b6a97d97e3fe07a7&oe=5F910A38

I think it relates to the new API change that facebook going to release soon https://developers.facebook.com/docs/graph-api/reference/user/picture/

My question is, shall I set some params in this gem to give me full user image urls that won't redirect, or I should add access token on frontend to query the currently generated profile urls.

Thanks.

@knu
Copy link

knu commented Nov 2, 2020

Are the new URLs with access_token added really fetchable? We keep getting 500 Internal Server Error.

@knu
Copy link

knu commented Nov 2, 2020

After upgrading this gem to 8.0.0, we have never succeeded in fetching images. Image URLs with access_token added do not seem to work at all.

% wget "http://graph.facebook.com/v5.0/xxxxxx/picture?access_token=yyyyyy&type=large"
--2020-11-02 16:47:48--  http://graph.facebook.com/v5.0/xxxxxx/picture?access_token=yyyyyy&type=large
Resolving graph.facebook.com (graph.facebook.com)... 31.13.82.1
Connecting to graph.facebook.com (graph.facebook.com)|31.13.82.1|:80... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2020-11-02 16:47:48 ERROR 500: Internal Server Error.

% curl -fsSLO "http://graph.facebook.com/v5.0/xxxxxx/picture?access_token=yyyyyy&type=large"
curl: (22) The requested URL returned error: 500 Internal Server Error

% irb
>> open("http://graph.facebook.com/v5.0/xxxxxx/picture?access_token=yyyyyy&type=large").read
Traceback (most recent call last):
        1: from (irb):7
OpenURI::HTTPError (500 Internal Server Error)

Removing the access_token parameter, it becomes accessible, at least for now.

You can view the image on a Facebook authenticated browser, though.

@simi
Copy link
Owner

simi commented Nov 2, 2020

@knu can you try with https as suggested per #345?

@knu
Copy link

knu commented Nov 2, 2020

@simi Ah, thanks, didn't notice there was already a PR for this. Will give it a try.

@pdfrod
Copy link

pdfrod commented Nov 2, 2020

@simi I tested #346 and it fixed the issue for me. Any estimate when it will be merged?

@simi
Copy link
Owner

simi commented Nov 2, 2020

@pdfrod there's no need to wait for that change, since it just change default configuration. You can configure it today per https://github.com/simi/omniauth-facebook#configuring in current version.

Anyway no idea about the merge for now.

@pdfrod
Copy link

pdfrod commented Nov 2, 2020

Ah right, I missed that. I guess I don't need to wait for a release then.

Thanks for the tip!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants