Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried to use the parser to pull in the feed of a Facebook page and it returned a 400 error code. Looking that up on Google, it appears it is an authentication error. Does some type of Facebook app authentication need to be implemented before trying to pull in this type of feed? How would I implement that authentication?
Thanks,
Ben
Comments
Comment #1
rashad612 CreditAttribution: rashad612 commentedI think it doesn't work with all profiles. Because it is not a registered app. Maybe the public profiles only.
Comment #2
BenK CreditAttribution: BenK commentedActually, I've tried both profiles and community pages that are public, but I still get the 400 Error. Any other ideas? I've tried bunches of IDs and I get the 400 error no matter what. Do you have a profile or community page Id that actually works for you that I can test out? What is the link you're using?
--Ben
Comment #3
rosemberg CreditAttribution: rosemberg commentedHi BenK,
I'm with the same problem. Have you managed to solve this? I'm wondering if the problem is related on how Feeds handles tokens.
Well, if anyone could help...
Thanks in advance.
Comment #4
rashad612 CreditAttribution: rashad612 commented@rosemberg: do you use app and its access token in your URL ?
Comment #5
rosemberg CreditAttribution: rosemberg commentedHi @rashad612,
That was the problem! I wasn`t using the access token correctly in the command line (URL) to gather the feed. Now I registered my app (website) and got the app secret and thus, the access token.
Thanks for the attention,
Rosemberg
Comment #6
rashad612 CreditAttribution: rashad612 commentedComment #8
TomSherlock CreditAttribution: TomSherlock commentedHi rosemberg. Do you think you could give some more details?
I've used Feeds before for BoingBoing and other RSS feeds. This is first time I'm using it for FB.
I've successfully established an app id and have used it successfully with the FB social module.
But there doesn't seem to be a field where I can enter the app id for the Facebook parser.
Thanks.
Comment #9
ainbritain CreditAttribution: ainbritain commentedI'm having a similar problem as TomSherlock.
I can get a token using info from my app and this query:
https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&clie...
This token works fine for me with feeds, and successfully adds nodes as expected when in the Feed field I add &access_token=MY_TOKEN to the feed URL.
However, according to my understanding of the Facebook API, tokens expire in 60 days! My site aggregates events feeds from 20+ different groups, so how can I avoid having to change the token on 20+ Feeds content posts every two months?
Ideally I want to be able to generate a new access token every month or so, using my app id and app secret. Does this require a different Feeds fetcher? I've tried hacking the httpget fetcher, but I can't figure out how to append text to the url (I get a type error, object cannot be converted to string.) I don't know how to make my own fetcher, I'm new to PHP and to Drupal.
It's trivial to get an access token in PHP alone, but I don't know how to plug this in to Feeds:
Any help is greatly appreciated! Thank you!
Also please correct me if I'm infringing on any Drupal Issues etiquette, I'm new here.
Comment #10
azin CreditAttribution: azin commented+1 for @TomSherlock's request, this issue is far from fixed unless the module allows users to add their Facebook APP ID and secret on Facebook Parser settings page, and periodically regenerate the access token.
Facebook expires Access Tokens regularly and this module is quite unusable if one is aggregating a number of pages, where imports may quit suddenly.
Comment #11
azin CreditAttribution: azin commentedIndeed this module cannot be used unless the Facebook auth issues are addressed, re-opening this issue.
Comment #12
abdul.muiz.meer CreditAttribution: abdul.muiz.meer commentedHi everyone,
I have managed to make some additions to the module to make it work(asking user for only App ID and App Secret in configuration and module gets access token itself). I have used the code in #9 to get access token.
Can anyone tell how can i make changes to the current module or should i make another project/module for this?
Comment #13
rashad612 CreditAttribution: rashad612 commentedPlease post your changes as a patch here, so that we can apply it to the module.
Comment #14
abdul.muiz.meer CreditAttribution: abdul.muiz.meer commentedI don't know how to create a patch. I can upload files that i have created/edited and you check weather they are according to Drupal standards or not and update your module.
Should i do this?
Comment #15
abdul.muiz.meer CreditAttribution: abdul.muiz.meer commentedHere is the ziiped folder i have made some changes in .module file and added new feedsfacebookfetcher.inc file.
Comment #16
artofeclipse CreditAttribution: artofeclipse commented@abdul.muiz.meer I will handle this from here thank you :)
Comment #17
abdul.muiz.meer CreditAttribution: abdul.muiz.meer commentedYou are welcome...:)
Comment #18
artofeclipse CreditAttribution: artofeclipse commentedThe issue will be solved once you use the following URL structure
https://graph.facebook.com/APP_ID/feed?access_token=YOUR_APP_ACCESS_TOKEN
and it should be https protocol not http.
I test this and it worked on my local machine, if you have any other questions please reply on issue.
Comment #19
abdul.muiz.meer CreditAttribution: abdul.muiz.meer commentedI did make this URL when user submits Api key and secret.
There is a new fetcher (Facebook fetcher) in list of fetchers, which you need to select and than pass url like "http://graph.facebook.com/{id}/feed" along with api key and secret in seprate textboxes (made available by fetcher) and rest of the work is done by fetcher.
Comment #20
artofeclipse CreditAttribution: artofeclipse commented@abdul.muiz
I checked your code, it need some cleanup I will commit it today :) but for now using the access token key in the URL fix this issue, thank you for you effort :)
Comment #21
pinkonomy CreditAttribution: pinkonomy commentedWhere can I see these separate textboxes?I cannot see them.
I can only see an HTTP fetcher and a File upload featcher without textboxes.Am I missing something?
Comment #22
abdul.muiz.meer CreditAttribution: abdul.muiz.meer commented@pinkonomy Have you downlaoded module from comment #15?
Comment #23
pinkonomy CreditAttribution: pinkonomy commentedAh sorry,will try that,thanks
Comment #24
RobertInOP CreditAttribution: RobertInOP commentedI have tried both using all the files from #15, and just the .module and the FeedsFacebookFetcher.inc files. Either way, I'm not seeing a new Facebook fetcher, only the same HTTP and file upload ones as in #21. Maybe I'm missing something?
edit: Maybe I did miss something, not sure what. But, now I do have the Facebook fetcher. After switching to that, I now have Application ID and Application Secret in my source content node. The feeds import seems to be working as expected also.
Comment #25
gillarf CreditAttribution: gillarf commentedYes I agree, I can't see those fields either. I can see the Facebook Fetcher though, but no config fields on the import page.
Comment #26
RedEight CreditAttribution: RedEight commentedArtofeclipse, did you ever commit that change? I just pulled the latest code from drupal.org and I don't see this fix at all.
Comment #27
RedEight CreditAttribution: RedEight commentedI've downloaded the zip file from #1181858-15: 400 Error: Authentication?. While it seems like this might work, I believe a rewrite is in order. We should add Application ID and Application Secret fields to the fetcher's settings form and set the import form to default to those two values.
I've attached a patch made from abdul.muiz.meer's module posted in comment #15. Artofeclipse said he was going to rewrite and commit the fix, but he said that back in July of 2013 and nothing has been done since.
PS: for those of you having issues after dropping in the new code, make sure you clear your cache before trying to enable the new fetcher. It didn't appear until I had cleared cache.
Comment #28
krisrobinson CreditAttribution: krisrobinson commentedI know this is old, but instead of using the new feeds facebook fetcher etc. I believe you can create a facebook app and use the following url structure for the call:
https://graph.facebook.com/{id}/feed?key=value&access_token={app_id}|{app_secret}
Comment #29
mpardala CreditAttribution: mpardala commented@honucreative I've tried to use that kind of URL, from the browser it works perfectly fine, but when I've tried to use it in the feed aggregator configuration, Drupal doesn't recognize it as a correct URL and doesn't save it
Any thoughts on that one? Thanks
Comment #30
ibraaheem CreditAttribution: ibraaheem commented@mpardala
It is not recognizing it because of the character "|". You have to use the urlencoded version which is %7C
The url them becomes
Comment #31
ibraaheem CreditAttribution: ibraaheem commentedI had this problem earlier with Rules and this fix worked for it.
Comment #32
wheelercreek CreditAttribution: wheelercreek as a volunteer commentedNot sure about others but this is still an issue for me. I modified the patch in 27 just a bit here to store the values as variables, so the form remembers them.
Comment #33
wheelercreek CreditAttribution: wheelercreek as a volunteer commentedComment #34
wheelercreek CreditAttribution: wheelercreek as a volunteer commentedI'm not sure if others are still having this issue, but I modfied the patch from 27 just a bit to store the values as variables.
Comment #35
B_manPatch file content purged by author's request.
Comment #36
wheelercreek CreditAttribution: wheelercreek as a volunteer commentedActually this is a better one here. Need to add a way to select fields coming from Facebook graph. This module currently is only bringing in the ID, Message, and created_time - no matter what fields are selected in the Mapping. This patch (36) allows users to specify what fields they want to add in.
Comment #37
wheelercreek CreditAttribution: wheelercreek as a volunteer commentedErg.. sorry - Here is the patch I meant to upload!!