Paul Houlihan
Paul Houlihan

Reputation: 3

Facebook problem: cant get user id into iframe without authorization

I have a facebook page with an iframe app.

I want it to be able to work in the same way as http://www.facebook.com/pepsi With the following user journey.

  1. User goes app tab on my page.
  2. User is prompted with a page, partial content, that invites to click the like button
  3. User clicks like and is shown full content.

all this is done without the client needing to login or authenticate.

My problem is that facebook is not passing me the user id.

I have tried var_dump($_REQUEST); and var_dump($fb->fb_params); to see if user id is there but nothing.

I dont think php sdk 3.0 or oauth works for signed_request

Can someone tell me how I get the user id from facebook without login?

thanks

Upvotes: 0

Views: 4304

Answers (1)

Steven Mercatante
Steven Mercatante

Reputation: 25315

Unless the user grants your application permission, the signed request will not contain their user id. See the docs for signed request.

If the user has not authorized your application, your application will only be passed a subset of the above information.

This includes the user object (although it'd be nice if Facebook specifically mentioned what data is or is not passed for unauthorized users - I banged my head against the wall for a bit trying to figure this out.)

That being said, you don't need a user to be authorized in order to "like-gate" a page.

Upvotes: 5

Related Questions