Search code examples
javascriptfacebookiframe

How to get FB id without connecting


I know at first this sounds evil, but I'm not trying to be at all. I'm only trying to get the users Facebook ID without having to connect to FB. I basically want to unique the user on my site by their social id.

If you use facebook's comments feature, without being connected, they have your ID and picture. The picture is easy because it's just a URL, but that ID, how do they get it?

Obviously they use iFrames, and maybe that's where the story ends. Because of cross domain scripting I can't get into that iFrame to grab the ID. This is a case where it's so close yet so far away. I can get there via dev tools but I can't get that ID via JS.

So the question is, does anyone know a way to get a users facebook ID without having to connect to facebook first.

Thanks!


Solution

  • Sorry but you cannot do this, as Facebook does not expose this data without explicit user consent.