Closed (fixed)
Project:
Feeds OAuth
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2013 at 19:39 UTC
Updated:
13 Jun 2013 at 05:54 UTC
Jump to comment: Most recent file
Comments
Comment #1
dsnopekAttached is the beginnings of a patch. It removes the compile time errors from trying to use OAuth2HTTPSFetcher, but I still haven't been able to get the module to work. I may look for a different solution rather than trying to fix this module.
Comment #2
dsnopekOk, I've managed to get OAuth 2.0 working minimally against the Google OAuth 2.0 implementation. There are still a bunch of things to implement (namely, using the refresh_token to refresh expired keys) and clean-up, but it works!
Comment #3
infojunkieThanks a lot for this. Please let me know when it's safe to test, and a testing scenario please :-)
Comment #4
dsnopekThis patch is finally ready for review! The latest version will refresh the access token automatically when it expires and it makes minor updates to the OAuth 1.0 support for the changes I made to the DB and API (although I haven't tested it).
I'm using this to make authenticated requests to the YouTube API. In that API, when pulling a video feed, it won't give you the tags unless you are authenticated as the user who owns the video.
I'm using Feeds: YouTube Parser to actually parse the YouTube specific data out of the Atom. Here is the issue in the queue over there: #1880326: can't import youtube keyword tags (add information about feeds_oauth to the docs!)
To actually test that scenerio, you'll need an account on YouTube, with at least one video with some tags on it.
The feed URL will look like:
... except with username replaced by your actual YouTube username.
If you create an importer which uses the "HTTP Fetcher", "YouTube parser", "Node processor" and maps "Tags" to a taxonomy field, you'll notice that it never adds any tags!
To do OAuth 2.0, you'll need to create a project with access to the "YouTube Data API" and add a "Client ID for web applications" in the Google APIs Console: https://code.google.com/apis/console
Use the "HTTPS OAuth 2.0 Fetcher" with the following settings:
Now when you run the import, you should notice that your taxonomy field will get filled with the tags from the YouTube videos!
Sorry for having such a complicated scenerio, but it's what I've been working with. :-)
Comment #5
dsnopekOh, and I forgot to add that after you apply the patch you need to run
update.phpordrush updatedbbecause it makes changes to the database schema.Comment #6
infojunkieThanks, will try this shortly.
Comment #7
infojunkieWhat version of Feeds are you using? Using the latest 7.x-2.x from git, I get an error:
I haven't hooked the OAuth fetcher yet, just trying to import videos anonymously.
Comment #8
infojunkieNever mind: it was this issue that's fixed in Feeds YouTube: #1406238: Recoverable fatal error: Argument 2 passed to FeedsProcessor::process() must be an instance of FeedsParserResult, null given
Comment #9
dsnopekAh, yeah, sorry - I'm using the 2.x-dev version of feeds_youtube, I had completely forgotten about that. :-)
Comment #10
infojunkieCommitted to the latest dev, after testing on a demo site. Thanks!
Comment #11
dsnopekAwesome! Thanks so much for taking the time to review and test the patch and get it committed so quickly. It always really feels great to spend a couple days hacking on something and see it get accepted upstream - but I'm not sure I've ever experienced it happen so fast. :-)
@infojunkie++
Best regards,
David.
Comment #12
infojunkieThanks. The timing was right - I am toying with a Feeds-based project these days.
Any interest in co-maintaining Feeds OAuth? :-)
Comment #13
dsnopekThanks for the offer! I would be interested in helping co-maintain Feeds OAuth, at least in the near term. I'd love to help get a full Drupal 7 release out.
Comment #14
infojunkieWelcome to the project! I will create some tickets that I see are necessary for the 7.x-1.0 release - let's discuss them.
Comment #16
westis commentedI've tried the solution in #4, but got two errors. One I managed to solve, the other not.
The first issue was that I had to set http://[sitename]/feeds/oauth2/callback/youtube as Redirect URI in the Google APIs Console.
The second issue I get now, when trying to import using the Feed Importer I created, is the following error message:
Trying to make a request without a token secret over an unencrypted channel. Use OAuth2Client->setAllowUnprotected(true) to allow this.What does that mean? I have added the Consumer Secret etc. in the Feed Importer. But this seems to be something else?
Comment #17
westis commentedAdding to this and answering my own question: both the site URL and the feed URL must use https.
I also had to add this redirect URI to the Google API Console: http://mydomain.com/feeds/oauth2/callback/youtube
Comment #18
infojunkieThanks for documenting your answer.