Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

FB PHP SDK Issue

  • 19-03-2014 2:20pm
    #1
    Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭


    I'm trying to integrate the Facebook PHP SDK to allow users to login onto a website with their Facebook account. Below is the code I'm using, I'm logged into Facebook and the first time I go and click on the login link it pops up with the 'allow Facebook share profile information with this website' message which is grand, when I click OK it redirects back to the login page on the website still displaying the login URL.

    I did notice that there is a code parameter now in the address bar url with a long string.

    Can anyone suggest if I'm missing something or doing something wrong?!

    As always any help greatly appreciated, thanks.
    $vFacebook = new Facebook(array(
      'appId' => '....',
      'secret' => '....',
      'fileUpload' => false,
      'allowSignedRequest' => false,
    ));
    $vUID = $vFacebook->getUser();
    $vLoginURL = $vFacebook->getLoginUrl(); 
    
    if ($vUID)
    {
    	try {
    		$vFBUserProfile = $vFacebook->api('/me','GET');
    		var_dump($vFBUserProfile);
    		exit();	
    	}
    	catch (FacebookApiException $e)
    	{
    		echo 'Please <a href="' . $vLoginURL . '">login.2</a>';
    		error_log($e->getType());
    		error_log($e->getMessage());
    	}
    }
    else
    {
    	echo 'Please <a href="' . $vLoginURL . '">login.1</a>';
    }
    


Comments

Advertisement