简体   繁体   English

授权 facebook 应用发布到页面墙,但不发布到用户墙

[英]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.我有一个 facebook 应用程序,它可以使用管理员的“publish_stream”权限发布到页面的墙上。但是我不想有能力在用户的墙上发布,只有他们控制的页面。

Since this is being done automatically I will need a permanent token (offline_access) and obviously the publish_stream permission.由于这是自动完成的,我将需要一个永久令牌(offline_access)和显然是 publish_stream 权限。 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 .我见过一些应用程序,例如页面中的便笺应用程序,其中设置了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?这会更容易,但是有谁知道我如何通过图表 api 请求页面的 publish_stream 权限?

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.如果您担心“意外”发布到用户的墙而不是页面,您可以确保使用/me/accounts端点中为您的用户提供的 access_token。

So, your choices are pretty limited here if you want to use the offline_access permission to post to a pages wall.因此,如果您想使用offline_access权限发布到页面墙,您的选择非常有限。 Limited, as in, you need to have publish_stream and manage_pages permissions.受限,例如,您需要具有publish_streammanage_pages权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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