Hello
Thanks very much for this great module. I just have one problem after following the video tutorial - when I add a new content, my rule should post it to facebook, however I get the following message:
Facebook SDK threw an error: OAuthException (#200) The user hasn't authorized the application to perform this action
Do you know what I have or haven't done correctly and how I could resolve this?
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #41 | fb-auto-post.jpg | 53.79 KB | Anand Parmar |
| #40 | add_publish_pages_permission-2284189-40.patch | 1.91 KB | Anonymous (not verified) |
| #35 | Screen Shot 2015-04-08 at 6.04.10 PM.png | 56.1 KB | benmmc |
| #19 | 2015-02-16_22-33-26.png | 78.25 KB | boabjohn |
Comments
Comment #1
carlbowles100 commentedI managed to fix this by setting appropriate permissions for each role under /admin/config/services/fbpermissions
Comment #2
carlbowles100 commentedComment #3
pyxio commentedI have the same problem. I was not able to solve it via permissions :( any other possibilities i can check? thanks
Comment #4
e0ipso@drupalstrap it's possible that you did not authorize the application to start with.
Comment #5
kaizerking commentedsame problem here permissions did not solve
I am trying to auto post a node to facebook page
i.e when ever any authenticated user posts a content type "post" it should be posted to Fb page
setting all available permissions also did not solve
Can some one help me on what permissions need to be set in my scenario?
Comment #6
pavelyonov commentedHi there, i have same problem. looking around few days for solution but still not found it.
I just setting up everything fine and when try to save article show me this message: "Facebook SDK threw an error: OAuthException: (#200) The user hasn't authorized the application to perform this action" I allowed all kind of permissions in /admin/config/services/permissions for administrator. I really dont know what more i have to do to work this module. Please help.
Comment #7
jemisond commentedSame issue
Comment #8
jemisond commentedComment #9
e0ipsoI don't want to sound like a broken record, but I'm going to move this back to fixed. This is the exception Facebook returns when an action is not authorized. This basically means that you're trying to do something you did not ask permission for.
If you have selected all permissions this means that all login requests will ask for those permissions, but if you already logged in you're stuck with the permissions you approved. You will need to go to the admin page and logout and then log back in.
Please, feel free to reopen if you can corroborate that this problem is related to any piece of code that can be fixed.
Sorry for the inconvenience and thank you for participating in the issue queue.
Comment #10
kaizerking commentedLog out and login worked for this issue
Comment #11
kruser commentedI'm trying to publish to a fb page upon saving a new node. I tried logging out/in, un/re-installing, and still can't get past this message.
When I try to login to facebook, it shows an alert, "The following permissions have not been approved for use and are not being shown to people using your app: manage_pages. Submit them for review or learn more." - From what I've read, the app owner doesn't need to submit for review, but maybe we really do now??
On admin/config/services/fbautopost under the Facebook page information, I can see and select from any of my pages. So I'm confused what permission will get this to work.
Update: I found that the alert really doesn't matter. To post to the page you also have to enable the "Publish Actions" Extended Permissions on admin/config/services/fbpermissions selected - So you need both Manage Pages and Publish Actions to post to a page.
Comment #12
carlbowles100 commentedhave you been to /admin/config/services/fbpermissions and given permissions for each of the required roles? that's what fixed this for me. hope this helps.
Comment #13
aminfa92 commentedYou should live your app on Facebook developer.
At the status an review page set "Do you want to make this app and all its live features available to the general public?" as Yes.
This solves my problem.
Excuse me for my bad English.
Best regards.
Comment #14
Tharick commentedYeah guys FB auto post works fine :-)
But I have one more query, can anybody help me out?
If we post one content from our site, it will automatically generate as post on FB page. But when we edit/modify the same content what we posted on FB, it should be update on FB page.
How can we do this via rules? please help me guys?
Comment #15
e0ipsoI believe this was covered in the docs a while ago. Documentation is very hard to write, so if you want to show a token of appreciation for all the work put into this module, please write a tutorial in there.
https://www.drupal.org/node/1914896
Comment #16
boabjohn commentedG'Day @e0piso, or buenos dias, que tal hombre?
Very sorry to re-open this one. It surely deserves some proper documentation. Perhaps I can try to start some here as a way to explain what trouble I'm having.
Usecase:
A non-profit organisation has a Drupal site, and they have a Facebook *page*. They wish to publish news items on their Drupal site and autopost to the FB page.
(1) Authorise the developer as FB admin
The client adds me (ie, my *personal* FB account) as an admin to their page. Now I am authorised by FB to "do things" with that page.
(a note for further discussion: this arrangement may cause problems in the future ...how can I set up the app and permissions without needing to use the client's personal FB account?)
(2) Developer creates App
I go to https://developers.facebook.com and under [My Apps] choose to [Add new App]
(3) Configure App on FB
Under [Settings] > [Basic] I fill in the basic info and copy out the App ID and App Secret
Under [Settings] > [Advanced] I make sure that the Client OAuth login is enabled. I copy out the Client Token and save it for later (?) I don't know any other settings to make on the [Advanced] tab
(4) Check the App on FB
Clever people may know how to use the Test App process...I don't. The main thing I look for is on the [Dashboard]. My App name has a green dot and a note that "This app is public and available to all users"
(5) Install Drupal module and create Rules
This is well documented already, but not the permissions
(6) Set Drupal user ownership for facebook_publications in Rules
This is unclear to me. The client users will be posting new Drupal content. But in Rules I am asked to set a specific user to own the facebook_publication entities. Taking a punt, since these are "internal" content objects, I set the user ID to 1. But I will point out that it is yet another place where we could have a question about permissions. Needs to be explicitly documented.
(7) Set the Drupal: Facebook Permissions
Permissions are set at: ../admin/config/services/fbpermissions
This looks like a well-thought-out UI that allows us to select first a Drupal role, and then connect that role with the FB-specific permissions that might be required.
We use the v2.0 Version
In my dead-simple usecase, we are only interested in [Extended Permissions - Publish] > Publish Actions
We find that, for all roles, this value is already defaulted on.
I believe this is the only action needed to publish our content onto a FB page (link and status updates)
(8) Log out / Log in
Based on comments in this thread...Not sure what usecase this is for...or *what* we are logging in and out of. To be safe I log out of both Drupal and Facebook. Then re-log in.
(--) FAIL
Finally we give it a try. Publish a new content node and get the error reported above:
Facebook SDK threw an error: OAuthException: (#200) The user hasn't authorized the application to perform this actionRead this thread, note e0piso's patient guidance, but remain confused about permissions, or what to do next.
So: deal to you (and the d.o community)... Please help me troubleshoot this oauth problem and I will fix/finish the documentation started here and drop it into the module's doco pages.
Thanks indeed!
Comment #17
e0ipso@boabjohn can you do the same tests using the same credentials as the FB fa page owner?
Comment #18
boabjohn commentedG'Day mate, thanks for the look-in.
Can I check what you mean in this case?
But...I'm probably confused still. Sorry man!
Can you offer a few more simple guidelines for how I should test?
Thanks in advance!
Comment #19
boabjohn commentedComment #20
boabjohn commentedJust reviewing:
1. On the FB Developer site, under the [Status & Review] tab, my app clearly states that it is *only* authorised to:
That's it...there's no mention of extended permissions. To authorise the app for publish_actions and manage_pages I *must* submit the app to FB review (apparently). This involves a lot of silly business aimed at people who are developing apps for public use.
Have I got something wrong here, or is this the "proper method"? Seems very obtuse.
2. On my Drupal site, in fbpermissions, of course I have authorised the app to publish_actions.
But it appears that FB doesn't care what is declared by Drupal...I still have to vett the app with the FB review process...and that just seems awkward given the fact that this "app" should not really be public, is not intended for public use, and has no UI of its own. It's just an authorisation widget to exercise the FB API, right?
Anyway, I have tried to fill out the FB review steps best I could andwe'll see what happens next.
If anyone can set me onto the proper cluetrain it would be HUGELY appreciated!
Thanks,
JB
Comment #21
boabjohn commentedWell, I guess it's my turn to "sound like a broken record" to borrow the phrase from @e0ipso at #9 above. However, I am increasingly convinced that there is something wrong with the module.
Trying to sort the OAuth error out means I've had to learn a bit about Facebook. As reported above at #20, I went through the process of submitting the App for Review at Facebook. They turned it down, noting:
Ok, so as far as FB is concerned, the app that I admin should be able to publish content to FaceBook using the app.
However, FB returns a 200 OAuth error saying the "user" hasn't "authorised" the application.
So what does that mean in terms of configuring this module?
Obviously if I set fbpermissions to allow role=admin to use publish_actions and manage_pages, then I assume that this is the permission being passed to FB along with the API keys so that it receives a post request *as an authorised user*.
However, FB says the user has not authorised the app for that action.
PLEASE can someone wade in here to explain which part of the authorisation train has gone off the rails?
Until shown otherwise, I am assuming that the module itself is dropping some bit of the API exchange, and thus this is a *major bug*.
Apologies for going on like a broken record: I'm sure there must be some configuration that I'm missing...but it is definitely NOT OBVIOUS.
Comment #22
boabjohn commentedComment #23
boabjohn commentedJust to be clear, "I" am an admin for the Facebook **page** and "I" set up the FB **App** on FB Developer, so "I" am the administrator from FB's perspective. "I" am also U1 on the Drupal website.
Of course the actual username and password for my Facebook account have nothing to do with the U1 Drupal account...nor should they.
As U1 I login to Drupal and configure the FBAutoPost module to give it the secret API details, and I also set the fbpermissions. So that should be the end of the story....
How then does FB return the OAuth error???
Comment #24
e0ipsoIt seems to work for other people. Most people in this thread had some configuration error while setting up their Facebook app or permissions.
I agree with you on that the documentation does not cover this. Can you add it?
Comment #25
duiweboer commented@e0ipso : thanks for the great module!
@boabjohn:
I had the same problem as I had no idea how to add the app on facebook. I managed to resolve it by doing the following:
In fb developer -> App Details -> Under "App Center Listed Platforms" -> click the "Configure App Center Permissions"
I changed the "Auth Totken Paramater" to "URI Fragment(#access_token..."
Under "API Version and App Center Permissions" I added: "manage_pages" and "publish_actions"
On drupal fbpermissions for now I just ticked everything for roles "authenticated users" and "administrators"
I am sure not all of it is needed, but I do not have time at the moment to see what exactly solved it, but I am sure this should get you going and you can complete the documentation. Let mek now if I can be of any further assistance.
Comment #26
boabjohn commented@e0ipso: yep I'd be happy to contribute documentation *once I'm actually publishing*...at the moment I'm simply floundering around trying to turn on any permission in sight in order to get the app to post.
@duiweboer: thank you so much for the interesting pointer to the App Center Permissions. It did not clear the OAuth problem in my case. Mysterious...and I would again wonder why such permissions would be needed (ie *App Center*) when the app is not really supposed to be coming in contact with the App Center. But again, that is vague reasoning on my part: I really don't understand the FB process.
Bottom line: I've set the App Center as suggested and once again turned on any permission that looked even distantly related to manage_pages and publish_actions in Drupal>fbpermissions
Same result.
@duiweboer...I would be more than happy to offer some sort of short term contract (a few hours?) to go through our configuration and see if you can spot what's happening?
Thanks..and respects to the immensely talented and vastly over-committed @e0ipso of course for helping to bring such a great functionality to Drupal.
Kind regards,
JB
Comment #27
boabjohn commentedMy offer still stands: cash for short -term contract to help us sort this out.
We're suck on this point.
FB AutoPost is just the right size solution for us...clearly other people get it to work...no one seems to have been able to clue us in as to what specifically is wrong in our case.
Any help most gratefully received (and compensated if need be!)
Please send me a mesage here on d.o
Comment #28
paonza commentedhi!
I resoved with this tip!
http://www.phpgang.com/how-to-post-into-a-facebook-page-with-php-using-g...
hope can be useful!
ciao
Fabio
Comment #29
drupalerocant commented@boabjohn #26,
I was having same problem as you and finally get it working! I read in some page that to authorise the app for publish_actions it was not necessary to submit the app to FB review although it is necessary for manage_pages. So i removed Manage Pages from Page Permission (admin/config/services/fbpermissions) and login again(admin/config/services/fbautopost). At first it showed me a message to send the app to review but i Saved configuration anyway. Published a post and i didn't get anymore errors.
Hope it helps!
Comment #30
nevosa commentedI was able to resolve this by changing in facebook "use as page admin", and then assigned all permissions to admin on drupal
(admin/config/services/fbpermissions).
Then I went to my user, and disconnected from facebook. The app permissions popuped again everything was sorted.
Comment #31
e0ipsoAs much as I want to find more time to contribute to FB Autopost I can't find it. It would be awesome if any of you created a documentation page to link gathering all the tips & tricks listed in this issue.
Maybe updating this https://www.drupal.org/node/2360835 will be enough.
Many thanks to all of you who contributed here!
Comment #32
Anonymous (not verified) commentedI have had the same problem as boabjohn & like him, I have been unable to come up with a set of configurations between Facebook App, Facebook page, & this module that allows me to successfully post from Drupal to a Facebook Page. A big part of the problem is the ugliness of Facebook's documentation & how convoluted their OAuth & App implementation is.
Anyway, I am currently using an alternative method until I can get this figured out & thought I would share it in case others have this problem & cannot resolve it. The alternative method: I have installed the Twitter module, which allows you to post to Twitter in a manner comparable to what Facebook Autopost does for Facebook. Within Twitter you can configure an app that will post any tweet you make to a Facebook account or Page timeline (or both). So from Drupal to Twitter to Facebook--kills two birds with one stone & works well.
P.S.: Twitter's App creation & configuration process is so much nicer than Facebook's!
Comment #33
Langley commentedLately ive also encountered this issue on installation that previously worked with testing account. After trying all the tips described in this thread i finally used google properly.
I came across latest facebook changelog stating:
Changes to Page APIs:
publish_pages Permission - This new permission is required to publish as a Page. Previously publish_actions was required. People who granted manage_pages and publish_actions before v2.3 have automatically been granted publish_pages. If anyone logs in via v2.3, you'll need to request publish_pages explicitly in addition to manage_pages.
After adding publish_pages to the permissions listed in the module and granting the apps permissions again everything is working as expected.
Comment #34
bpadaria commentedThanks Langley,
Adding publish_pages permission worked perfectly.
Comment #35
benmmc commentedHow did you add publish_pages permissions, exactly, @bpadaria?
I submitted my app for review with the publish_pages permission, and got back this.
I've done every step, but still get the OAuthException (#200) error.
Comment #36
Anand Parmar commentedI am also getting the OAuthException (#200) error. Have followed every step and video tutorials. Kindly help.
Comment #37
Anand Parmar commentedI was reading the issue queue of another Drupal Module 'Facebook OAuth' at https://www.drupal.org/node/2464367
And I find this information which I feel is the cause of the sudden breakdown. It has these main points
Hopefully the module developer will be able to throw more light on this.
Comment #38
Anand Parmar commentedComment #39
Anand Parmar commentedWhile going through the changelog of Facebook graph api v2.3 at https://developers.facebook.com/docs/apps/changelog there is an informative paragraph about posts to page.
publish_pages Permission - This new permission is required to publish as a Page. Previously publish_actions was required. People who granted manage_pages and publish_actions before v2.3 have automatically been granted publish_pages. If anyone logs in via v2.3, you'll need to request publish_pages explicitly in addition to manage_pages.
Comment #40
Anonymous (not verified) commentedLangley: This solved the problem for me. I found that even after successfully going through the the Facebook App review process & gaining
manage_pages&publish_actionspermissions for my App, & even when using handcrafted Graph API POST URL requests (using http://hurl.it) with all proper access tokens, I was getting the OAuth 'user has not granted permissions' error. As soon as I patched this module to requestpublish_pagespermissions, & rerequested & granted permissions (this time withpublish_pagesrequested & granted), I was able to post to my Facebook Page as the Page both with this module & with handcrafted URLs. So it seems that it is indeed the new v2.3 API permission that is breaking this module.I am attaching a patch to add the
publish_pagespermission to the Facebook Autopost Permissions module. Apply the patch to the current dev version, & a new option will be available at admin/config/services/fbpermissions, under the Pages group, to assign thepublish_pagespermission to a particular user role. After applying the patch & assigning the role, be sure to log out at admin/config/services/fbautopost, & to delete the Facebook App you have configured from your user settings for your Facebook account. Then at admin/config/services/fbautopost, under Facebook Page Information, click to log in again, & you should be taken to Facebook which will prompt you to accept the Facebook App & give it permissions. Be sure to accept all permissions. You should seepublish_pagesas one of the permissions the App is asking for.Comment #41
Anand Parmar commentedI confirm rhclayto's patch is working. Attached is the screen shot of post updated from test website with image and body text to FB page wall.
.
The only puzzle needs to be resolved is I want to image or images of the node to be saved to FB photos in an album named by content type for example 'school-news' etc. If some one has an idea how to achieve this.
Comment #42
Anonymous (not verified) commentedThis should be a bug report since it's confirmed that because of the new Facebook API update the current code doesn't work. Also major for the same reason. Hopefully we can get this RTBC & committed soon.
Comment #43
Anonymous (not verified) commentedAlso going to put this in dev branch, since the patch is against that branch.
Comment #44
person101x commentedI am using the dev branch, but I am still receiving the #200 error code, even after logging out / logging in and granting all permissions for app to post on Facebook.
Any suggestions?
Comment #46
e0ipsoThanks @rhclayto for the patch!
This has been committed to dev. I'll be tagging a new release for this.
Comment #48
dany_faccio commentedI'm trying to apply @rhclayto's patch and, forgive me for my ignorance, but I have no clue of where to add it :(
"Apply the patch to the current dev version"-can anybody tell me where exactly is that, please? What file should I edit to add it?
Thanks a lot!!!
Comment #49
Anonymous (not verified) commentedOn the main project page, under Downloads, the 7.x-1.x-dev version should now have the patch already committed to it, so no there is need to apply this patch manually.
Comment #50
classicaldeal commentedIn configurations/web services/ fb permissions... i set all permissions admin is having for drupal authenticated user also but still not allowing to post on facebook page for my website www.classicaldeal.com , any thing else which needs to change ?
Thanks in advance
Comment #51
xadag commentedI had the same problem and solve it by :
Create a new app with the 2.5 api version
Apply this patch : https://www.drupal.org/node/2602478 and use the latest SDK PHP of Facebook from https://github.com/facebook/facebook-php-sdk-v4
And also on the facebook autopost permission admin page, set manage_pages, publish_pages permissions to the role authenticated user.
After that going on the facebook autopost admin page, logout from my account and renew login to set permission and autorisation for my facebook account and the app
After i was able to post to my pages. The user must be administrator of pages.