0

I'm trying to generate access token for specific user on facebook for restfb so i could share photos with my java app. I succeded to generate the token by entring facebook and copying it into my code. My question is is there any way to generate to token from the code itself? And if so how can i support the upload even when the user is not connected to facebook? Because i'm getting the error:

Exception in thread "main" com.restfb.exception.FacebookOAuthException: 
Received Facebook error response of type OAuthException:
Error validating access token: The session is invalid because the user logged out. 
(code 190, subcode 467)

Thanks a lot.

nat
  • 51
  • 5
  • Maybe the second answer might help http://stackoverflow.com/questions/13671694/restfb-using-a-facebook-app-to-get-the-users-access-token – Andy Jan 29 '15 at 13:36

1 Answers1

0

Facebook allows you to generate long lived token that lasts 60 days maximum. You have no option to create non-expiring token. You might want to extend it, but it cannot be generated as non-expiring token, as described here: https://developers.facebook.com/docs/facebook-login/access-tokens#extending

Eyal
  • 1,748
  • 2
  • 17
  • 31