PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, January 6, 2022

[FIXED] Retrieve Facebook User ID (or anything unique) without Authentication?

 January 06, 2022     facebook, facebook-javascript-sdk, facebook-php-sdk     No comments   

Issue

Is there anyway to get the Facebook ID of a user without forcing them to authenticate? I'm trying to create an app page where the user can only add an answer to a poll once, so I need to be able to identify viewers by some kind of unique identifier.

My preference would be to not force them to log in. I think it's bad UX to add 2 extra steps just so I can make sure a facebook user on a facebook page is unique. I don't need any permissions to their profile/etc.

BTW, I've seen similar questions though nothing current or close enough for me.


Solution

No possibility if you don't make your user log in, for security reasons, the user has to be aware you are collecting information about him, it's also why there is a login.

With the PHP SDK, to get the id after login:

$userId = $facebook->getUser();


Answered By - Jeff B.
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing