muesli / beehive

A flexible event/agent & automation system with lots of bees 🐝
GNU Affero General Public License v3.0
6.28k stars 319 forks source link

Facebook bee setup problem #264

Closed Invertisment closed 3 years ago

Invertisment commented 4 years ago

I wanted to fiddle with facebook bee and before I could even try it out I got an error. It's related to the deprecated post API.

I am in no hurry to fix anything and this doesn't impact me, but it would be nice for it to work.

https://www.nextscripts.com/news/2018/04/facebook-error-invalid-scopes-publish_actions/

CalmBit commented 4 years ago

Could you post the error here? I'd like to debug this and see what's going on.

Invertisment commented 4 years ago

I've tried again and this time I noticed that I didn't set my fb app to "live" (I haven't created any fb apps too). With this being out of the way it could work but now I get an error about the domain of the app (in lithuanian):

Nepavyksta atverti nuorodos: Nuorodos domenas nėra įtrauktas į programėlės domenų sąrašą. Programėlės nustatymuose, lauke Programėlės Domenai, pridėkite visus programėlės domenus ir subdomenus, ir jūs sėkmingai galėsite atidaryti šią nuorodą.

As I understand this basically means that I have to add the domain of the app to the Domains, which I already tried for a couple of times. This probably means that oauth is not able to use my donain for some reason. And probably as I've tried to make it work with localhost and 127.0.0.1 it may not work at all -- these are special domains.

My starting instruction for the app was to run it from a docker image like this: docker run --name beehive -e CANONICAL_URL="http://127.0.0.1:8181" -p 8181:8181 fribbledom/beehive

As I've doing this only for exploration I would like to have any tutorials that may be useful. Probably it would be a nice addition to the bee setup screen. Thanks.

CalmBit commented 4 years ago

This seems to cover this error pretty well. I'll have to research it more, but the HTTPS requirement might be the first place to start.

pbek commented 3 years ago

Invalid Scopes: publish_actions. This message is only shown to developers. Users of your app will ignore these permissions if present. Please read the documentation for valid permissions at: https://developers.facebook.com/docs/facebook-login/permissions

I did get the same error message when trying to retrieve an access token. The facebook hive tries to get publish_actions permission.

This permission doesn't exist any more (see https://stackoverflow.com/questions/50146705/facebook-publish-actions-permission).

I cannot find it on https://developers.facebook.com/docs/facebook-login/permissions or in the permission list on https://developers.facebook.com/tools/explorer/.

pbek commented 3 years ago

I valid permission could be pages_manage_posts.

pbek commented 3 years ago

I replaced the permissions in Beehive which allowed me to get an access token, but when I tried to post a message to my Facebook page I got an error:

ERRO[0490] [Facebook]: Error: [message:(#200) If posting to a group, requires app being installed in the group, and \
          either publish_to_groups permission with user token, or both pages_read_engagement \
          and pages_manage_posts permission with page token; If posting to a page, \
          requires both pages_read_engagement and pages_manage_posts as an admin with \
          sufficient administrative permission] [type:OAuthException] [code:200] [subcode:0] 
pbek commented 3 years ago

I tried to use the scopes "public_profile", "pages_manage_posts", "publish_to_groups", "pages_read_engagement" but wasn't able to get an access token on localhost because https was enforced by Facebook.

pbek commented 3 years ago

I created a pull requests for the scopes: https://github.com/muesli/beehive/pull/345