Welcome Guest, Not a member yet? Register   Sign In
Facebook Login (Tank Auth Social) Exception Problem, Can't login at first time.
#1

[eluser]Unknown[/eluser]
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

[eluser]Unknown[/eluser]
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/17502...-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 Smile





Theme © iAndrew 2016 - Forum software by © MyBB