Facebook access token invalid with message “session does not match current stored session”?

后端 未结 6 2215
一整个雨季
一整个雨季 2020-12-13 13:27

I have recently started getting this error while posting to facebook newsfeed stream of an app user, I do have an offline access permission for the access tokens, and they w

6条回答
  •  无人及你
    2020-12-13 13:31

    I also faced this issue while accessing the post comments from my command utility. In my case everything was working fine, until suddenly I got the error:

    The remote server returned an error: (400) Bad Request.

    After diagnosing the problem, I found that the Facebook access token is expiring after a period of time even though I created it with the offline_access option as below:

    https://www.facebook.com/dialog/oauth?client_id=[APPID]&redirect_uri=[URL]&scope=user_photos,email,user_birthday,user_online_presence,offline_access
    

    After wasting of lots of time on RND, I found that there is an option in the app's Advanced Settings for Remove offline_access permission. My client had enabled it, and that's the reason my token was expiring. Have look at the image below:

    Facebook offline access token

提交回复
热议问题