jsmos
jsmos

Reputation: 497

Getting full access token Facebook

I am trying to post the user's OAuth token to my database, so I can read their statuses using FQL.

I thought that this would work:

$access_token = $facebook->getAccessToken(); 

but it only returns the first portion.

I also tried this:

$token = $facebook->getAccessToken(APP_ID.'|'.APP_SECRET);

but it returns the same thing as above.

How do I get the auth token so I can store it in my database?

Upvotes: 0

Views: 117

Answers (1)

Mahesh Salaria
Mahesh Salaria

Reputation: 180

After callback use:

$facebook->setExtendedAccessToken();

and then call getAccessToken to get long lived tokens to store in your Database:

$access_token = $facebook->getAccessToken(); 

Hope this will help.

Upvotes: 1

Related Questions