I am having trouble to extend the expiration time of Facebook access token to 60 days. I was reading several articles on Facebook developer page: https://developers.facebook.com/roadmap/offline-access-removal/
Specifically, I am using Facebook C# SDK, and when I ask for authentication, I am doing FacebookClient.GetLoginUrl(), and work on the call by to get the access token.
Right after that, I try to use FacebookClient.GetAsync("oauth/access_token") to extend the expiration time by using the following URL pattern
https://graph.facebook.com/oauth/access_token?
client_id=APP_ID&
client_secret=APP_SECRET&
grant_type=fb_exchange_token&
fb_exchange_token=EXISTING_ACCESS_TOKEN
However, I don't see the expiration time of the access_token being extended. I did set my app to use deprecated offline_access... Anyone have experience with Facebook C# SDK and could give me some thoughts on this?
Did I misunderstand the meaning of "extend expiration time" means in Facebook doc?
Thank you very much!
If you want to make sure your Facebook page access token never expires, click “Debug” button. If you can see “expires: never”, it means Facebook page access token will never expire.
When your app uses Facebook Login to authenticate someone, it receives a User access token. If your app uses one of the Facebook SDKs, this token lasts for about 60 days. However, the SDKs automatically refresh the token whenever the person uses your app, so the tokens expire 60 days after last use.
By default, access tokens are valid for 60 days and programmatic refresh tokens are valid for a year. The member must reauthorize your application when refresh tokens expire.
The call you're making will return an access token, quite possibly not the same one you passed in. In other words, your existing token won't necessarily be extended, you may get a new one if required.
Make sure you have enhanced oauth dialog enabled and your redirect_uri is pointing to your website.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With