ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Facebook Login (Tank Auth Social) Exception Problem, Can't login at first time.

August 23, 2013 2:37am

Subscribe [1]
  • #1 / Aug 23, 2013 2:37am

    kargaa

    1 posts

    Hello,

    Sorry If there is a post like this question, I checked but I couldn’t find any..

    I’m using tank_auth_social for facebook login.

    After user giving access from facebook at first login it throws exception like this.


    Fatal error: Uncaught OAuthException: An active access token must be used to query information about the current user. thrown in /home/****/public_html/application/libraries/facebook/base_facebook.php on line 1271

    Yeah so we couldn’t have write token it means that yeah? But when I click to login and it works… The first one only gives exception due to one problem and its not about facebook token I think.

    I’m really newbie on facebook connect stuff, I updated facebook and base_book library but didn’t work.

    I hope had this problem and could help me.

    Thanks anyway.

  • #2 / Aug 31, 2013 12:29pm

    kargaa

    1 posts

    I really searched it alot, I tried different things different facebook login systems, but it was always akward that I really didnt realize that main problem was getUser function on base_facebook.


    First

    Please update sdk from github don’t download deprecated version (I did this mistake)

    Second

    Please update base_book with this function , check the link please.

    protected function getCode() {
    $server_info = array_merge($_GET, $_POST, $_COOKIE);

    if (isset($server_info['code'])) {
    if ($this->state !== null &&
    isset($server_info['state']) &&
    $this->state === $server_info['state']) {

    // CSRF state has done its job, so clear it
    $this->state = null;
    $this->clearPersistentData('state');
    return $server_info['code'];
    } else {
    self::errorLog('CSRF state token does not match one provided.');
    return false;
    }
      }

      return false;
    }

    http://stackoverflow.com/questions/17502765/when-using-codeigniter-facebook-php-sdk-getuser-always-returns-0


    3-  Also in every case add this code , auth_social controller.

      // Get Facebook User profile
      $accessToken = $this->facebook->getAccessToken();
      $user_profile = $this->facebook->api(’/me?access_token=’.$accessToken);


    It took my nearly 3-4 days , its really funny 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases