facebookcookiesfacebook-like

Is there an easy way to find a Facebook user's ID?


I need users to fill-in their Facebook IDs (a.k.a. "Admin IDs") in order to set the "fb:admins" property. There is no easy way to get the ID on Facebook but the value exists in their cookies (c_name).

I know it's not possible to read the cookies. Is there a way to get the ID or even just to show it to viewers so they can copy/paste it? Maybe by using OAuth? If getting the "fb:app_id" is possible - that works for me as well.


Solution

  • Ok, if picking the FBUID from an image filename is too complex for your users, you have two vaguely simple options:

    1. Your best bet may be to write a simple application that reads the signed_request and outputs their ID to the screen so they can copy/paste it. That shouldn't be too difficult.
    2. Alternatively, get them to go to the Graph API Explorer, which should preload with their user ID. This screenshot shows my UID as 100000248904869:

    Screenshot of the Facebook Graph API eplorer

    Hope that helps!