Вопрос

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