-1

Hey guys tried googling and searching for hours but no one could help. So decided to come here for help.

So I'm trying to create a system that detects if a user is logged but on their party websites. For example: I'm logged in on Facebook but www.abcefg.com detects I'm logged in.

First of all what is the correct name for something like this and how and where would I start.

I know I'll need to include some files/script on the third party sites etc..

Is it session handling ? I really don't know where to start.

I'm mainly a php guy

Update: I want do exactly the same thing as disqus.com

They detect if your logged in and you can post comments with your username on any site that as disqus

  • 6
    I think this question might have some information that would be useful for you? http://stackoverflow.com/questions/5233560/possible-to-find-out-whether-a-user-is-logged-into-facebook-over-javascript-api – mrcheshire Aug 18 '15 at 01:07
  • Thanks it's pretty much along the lines of what I'm looking for but how to create one for my own site.. So example: My site www.example.com visitors are on www.thirdparty.com.. Third party detects example.com users are using their site, so something like a welcome sign pops up saying 'welcome example.com user' – user3833066 Aug 18 '15 at 01:10

2 Answers2

0

If you want use Facebook Auth. I recommend you start with Facebook Developer Site: https://developers.facebook.com/ and create a app of your site

Then you go to this link, to find a solution to integrate the facebook auth into your site.

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=facebook%20oauth

Phat Tran
  • 3,404
  • 1
  • 19
  • 22
0

Using facebook SDKV5
Create fb object for your app

$fb = new Facebook\Facebook(array(
'app_id' => 'app_id',
'app_secret' => 'secret',
'default_graph_version' => 'v2.4',
));`

Then try to get access token using this object

$helper = $fb->getJavaScriptHelper();
$accessToken = $helper->getAccessToken();

Now use this tokken to query user information

 $response = $fb->get('/me?fields=id,name,email,first_name,last_name', $accessToken->getValue());

If you get information in the $response array that means user is logged in
Use in proper try catch this is a example and require all sdkv5 libraries
Good luck for your app