I see code in the common syndication parser for dealing with username/password (HTTP AUTH) protected feeds:
_parser_common_syndication_feedapi_get($url, $username = NULL, $password = NULL, $cache = FALSE)
... but I don't see anything in the UI that implements this feature. Am I missing something obvious?
Background:
I'm investigating how to pull tailored feeds from the Associated Press into Drupal nodes. AP Exchange provides Atom feeds without content but with links to NITF (XML) documents, which are on yet another protected server. At this point it looks like the common syndication parser provides us with a starting point for a separate AP module.
Comments
Comment #1
akempler commentedHey Steve,
I'm in the middle of implementing the same thing you are - pulling in AP Exchange Atom Feeds.
I created my own FeedApi parser which passed the username and password.
There probably is a better way but it worked for me.
I can send it to you if you want to take a look.
Comment #2
alex_b commentedThis could be a core feature of feedapi.
Comment #3
aron novakIt's implemented in Common Syndication parser now.
Well, in simplepie parser, i cannot see a trivial way to do this, because i have not found possibility to pass extra header data.
You can supply the auth data like this in the URL:
http://user:pass@server/pathComment #4
alex_b commentedIs this working? Who can confirm?
Comment #5
chrisschaub commentedBasic auth is also implemented in the lastest Simplepie from their docs and from looking at the code in the include file. Search for "Authorization: Basic" in simplepie.inc.
I think the real problem is that the Simplepie uses CURL to fetch the feed data. If you're using the drupal securesite module to protect your feeds, it does a 302 redirect and Simplepie's CURL doesn't store the cookie by default. So, the initial request authenticates but the redirect, the actual requested feed url is not authenticated. It can't handle a basic auth that does a 302 redirect to the real feed url. It would probably work if Simplepie stored cookies.
So, I should probably be posting this in the securesite module queue, but I wanted to throw this idea out and get feedback first. Does this seem like a plausible explanation. Did I miss something?
Comment #6
alex_b commentedClosing after an extended periodof inactivity.