简体   繁体   中英

Authorize facebook app to post to page wall, but not to users walls

I have a facebook app which can post to the wall of a page by using the administrators 'publish_stream" permission. However I don't want to have the ability to post all over a user's wall, only the pages they control.

Since this is being done automatically I will need a permanent token (offline_access) and obviously the publish_stream permission. But I'm unsure how to request this.

I have seen some applications, like the notes app in pages which have a setting for allow this app to post on wall . This would be easier, but otherwise does anyone know how I can request publish_stream permission for a page via the graph api?

For example, this is the request I use to get the user authorization code before requesting a token. I can't find an equivalent to request authorization for a page though.

https://www.facebook.com/dialog/oauth?
     client_id=YOUR_APP_ID&redirect_uri=YOUR_URL&scope=email,read_stream

You can't get permission to access only a page's wall / news feed without access to the user's also. If you're worried about "accidentally" posting to the user's wall and not to the page, you can make sure you use the access_token provided in the /me/accounts endpoint for your user.

So, your choices are pretty limited here if you want to use the offline_access permission to post to a pages wall. Limited, as in, you need to have publish_stream and manage_pages permissions.

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