We are working in Java with restfb to perform actions over facebook. The first thing we do is to get an extended access token using the access token that we obtain after a php oauth process. The code to obtain the extended token is-

FacebookClient facebookClient = new DefaultFacebookClient(shortLivedToken)
AccessToken extendedAccessToken = facebookClient.obtainExtendedAccessToken(apiKey, secretKey, shortLivedToken);
extendedToken = extendedAccessToken.getAccessToken();

For what I read and experienced, that extended token expires in two months. Is there any way to obtain an extended access token, with restfb, that never expires?

有帮助吗?

解决方案

No. You can not have a never-expiring user access token. In order to get refresh the token, the user needs to visit the app again.

More details on access tokens here.

Note: You can have a never-expiring page-access-token, as mentioned here: https://stackoverflow.com/a/18322405/1343690

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top