简体   繁体   中英

Facebook - Page feed using a cron

How to generate user access token for cron?

If I manualy generate user acces token here

I get this https://graph.facebook.com/475587132530747?fields=videos&access_token=CAACUjjG5ux0BACuotPrrMdFVWoqextT2TJd3LfrcZBLKN4cPa6FcF36YLkZAy9O78SCakzweH9eAIj8wZCHvb3CavagzPELvr6e3ntATzEHpCe9wxWmPLXYA5oHmk0UxelqZBqtsxc505axLLBAN5yfzPMpfzUdsdNFcqwO5a4XOZBZC2g905rQrvGgrJtVXIZD

That's ok, but this token has expired in 1 hours.

You cannot generate a user access token without the users activity. Facebook changed the validity of user access tokens to be 60 days maximum (extended), so an app that is not used by the user anymore does not have access to his profile anymore. It would be useless to limit the validity if it would be able to regenerate it with a cron job.

More information about tokens:

What you may need is an extended access token.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM