Facebook – Get Facebook user’s profile picture prior to authenticating app

facebookfacebook-graph-apifacebook-javascript-sdk

Summary:

I am working on a website that connects to Facebook through the Graph API. I was asked whether I can get a user's profile picture if they are already logged into Facebook, but prior to the user authenticating the app. Is this possible?

EDIT:
I know you can get people's profile picture by going to http://graph.facebook.com/USERNAME_OR_USERID/picture?type=large, but would I be able to get a user's username or ID if they are logged into Facebook, but have not authorized my app?


Details:

According to the Facebook API User documentation, you can get their Facebook ID without an access_token, and I know if you go directly to a user's /me URL you can see their basic information. With the Facebook ID, I can grab their profile pic.

However, when I try to call it from the website using the following code, I get an OAuthException error.

FB.api('/me', function(response) {
    console.log(response);
});

I'm guessing that they have to authenticate the app, but I'm looking to see if I may have missed a way of getting their profile pic.

Thanks for your help!

Best Answer

You can get everyone's Facebook profile picture without authentication.

You just call http://graph.facebook.com/USERID/picture?type=large. This URL redirects you to image URL.

Edit: Querying by username is not allowed anymore, so I updated USERNAME_OR_USERID as USERID.