Question

I am using RestFB in my Java console based (server) application. I need to use 'User Access Token' in my application and have copied the Short User Access Token (from Facebook dev tool) in my code and by using RestFB api, have acquired the new Long-Lived User Access Token.

Now my question is what should be my strategy to regain the new Long-Lived User Access Token , once my existing Long-Lived Access Token gets expired ?

As far as I know to gain new Long-Lived Access Token , I need a valid short User Access Token ... so how can I get this new Short Lived User Access Token in Java console application ?

Please note that I am sitting in Java Console application and if required I can even hardcode the user name & password of Facebook acount against which I need User Access Token. And there will be no end user interaction in my application

Thanks, Tony

Was it helpful?

Solution

what should be my strategy to regain the new Long-Lived User Access Token , once my existing Long-Lived Access Token gets expired ?

Without user-interaction, there's no other way you can get the short-lived access token and hence long-lived access token.

Your user visit your app and go through the authorization step again to get the short-lived token.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top