Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is a Facebook access token generated?

I use the following code:

$access_token = $object->getAccessToken();

This method sometimes generated an access token (118-char string) and sometimes it's a 49-character string with a pipe symbol which does not work properly.

Can I use same access token to post feed with different user id?

Why do access tokens not work properly in safari with iframe & non iframe?

Is there any link do access token documentation?

like image 218
amy Avatar asked Nov 26 '25 18:11

amy


1 Answers

Firs of all there are two type of tokens that are generated by Facebook

  • Application without User

    When there is no user using the application the application uses what is known as "App Access Token". The app access token can be represented as

    <APP ID>|<APP Secret>
    

    This token can retrieve all the public domain information for different Objects in Facebook, like it can be used to retrieve basic information about a User with specific ID, likes on a Public Page, Public Posts on a Page.

  • Application with User

    When User authorizes the application Facebook generates a "User Access Token" which is the access token with longer length. You can't use User Access Token of one user to do the actions on behalf of another User and if you try the action will be done as the User for whom the token was generated for(If you are not Using Extended Access Token it will also expire).

There is issue in setting the Cookies within an iframe in the safari due to which there is some issues in the application working.

For further clarification on Access Token check this documentation

like image 176
Anvesh Saxena Avatar answered Nov 28 '25 12:11

Anvesh Saxena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!