I’m trying to set up offline access for my Facebook App. The javascript part is in place, having the user authenticated at all. However I can’t for the life of me seem to send the authentication data from javascript to PHP.
Basically I am getting the access_token from the javascript getSession method, then I make my php request with access_token=<URL_ENCODED_ACCESS_TOKEN>, however the PHP SDK detects that the access token matches the application access token and chickens out.
I have no idea why my access token is that of the application, maybe because I’m the dev?
For what it’s worth, this is the line where the Facebook SDK bails on me:
$access_token = $this->getAccessToken();
if ($access_token &&
$access_token != $this->getApplicationAccessToken() &&
!($user && $persisted_access_token == $access_token)) {
$user = $this->getUserFromAccessToken();
if ($user) {
$this->setPersistentData('user_id', $user);
} else {
$this->clearAllPersistentData();
}
}
Can’t seem to highlight a line, it’s this line:
$access_token != $this->getApplicationAccessToken() &&
Can anyone explain to me how I pass the authenticated user from Javascript to PHP?
Also, I assume that since the user has given permission for offline access I can store this access token for later use?
Thank you
Solved eventually by passing the access token as a GET parameter, then using API calls that accept manually supplying the access token. I was unable to figure out a way where it would handle this automatically.