Search code examples
facebooklaravellaravel-socialite

Get Facebook Long Time access Token using Laravel Socialite


I am using Laravel Socialite for my laravel application to login with Facebook. I have seen its documentation, but I haven't found any thing related to getting long time access token. Can any body let me know how can I get long time access token using Laravel Socialite?

The access token that we receive using Socialite says [expiresIn] => 5174875. What is the Unit of this? Is it short term or long term access token?


Solution

  • You already have a long-lived token.

    [expiresIn] is the number of seconds until this access token expires.

    5,174,875 seconds is (approximately):

    • 86,247 minutes
    • 1,437 hours
    • 59 days

    Long-lived access tokens are good for about 60 days, thus the token is long-lived.

    Source: facebook for developers