Support » Plugin: Social Connect » [BUG] Facebook access token isn't saved

  • When trying to get extended access token as described here, I found out that the access token isn’t saved at all into db, because the code


    in the facebook/callback.php doesn’t have the userid, as the user isn’t yet logged in.

    Could that be fixed?

Viewing 1 replies (of 1 total)
  • I think I solved this by adding:

    $sc_access_token = $_REQUEST['social_connect_access_token'];

    And than later saving the value, when the user is created


    I also found a way to save the extended access token (works only with the new Facebook SDK). I’m passing the user’s Facebook ID into this function

    function get_extended_token ($fb_user_id) {
        //facebook application configuration
                require_once(dirname(__FILE__) . '\lib\facebook-php\src\facebook.php' );
            catch(Exception $o){
        $config = array(
            'appId' => 'aaa',
            'secret' => '12345',
            'allowSignedRequest' => false // optional but should be set to false for non-canvas apps
        $facebook = new Facebook($config);
        if($user_id) {
            global $current_user;
            try {
                $access_token = get_user_meta($current_user->ID,'facebook_token',true);
                $access_token = $facebook->getAccessToken();
            } else {

    Not sure where this code should be put in Social Connect…

Viewing 1 replies (of 1 total)
  • The topic ‘[BUG] Facebook access token isn't saved’ is closed to new replies.