문제

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