Yeah, if you have Authorizer configured to restrict access to only logged in users, then when an anonymous user visits the feed URL, it will get redirected to wp-login.php. Since your custom PHP script is making the request for the feed, it knows nothing about the client’s login credentials.
Similarly, when you use Authorizer to authenticate via CAS, it creates a WordPress authentication cookie upon successful sign in; without this cookie, WordPress will think you aren’t logged in.
Authorizer does support SSO (single sign on) in CAS (so, for example, if you’re already logged into CAS, when you visit the CAS endpoint it will automatically log you in and redirect you back to WordPress).
Try this to get started: on your custom PHP script that will be compiling the RSS feeds, drop in an iframe that points to wp-login.php on the private WordPress server, with a redirect pointing to the rss feed URL, and with the CAS querystring value (which will trigger a CAS login). That URL will look something like this:
https://your-wordpress-site.edu/wp-login.php?redirect_to=2Ffeed%2F&external=cas
Assuming the client has already CAS authenticated (to get to the portal), it should load the raw RSS xml in the iframe.
If this works, we can move on and try to integrate it into your aggregator. Note that you’ll need the client to request the RSS feed, not a script on the server (because the server won’t be CAS authenticated). If you need to further process or prettify the raw xml, consider using an AJAX request where the client retrieves the RSS feed, and then sends the output to your custom php script for formatting.
Thanks. I will work on your suggestions and let everyone know what comes of it.
I’m not very experienced with RSS and still a bit new to JQuery, but I was able to get a good working draft that should meet our needs by referring to these two documents/pages:
Here’s the I came up with that we should be able to pull into our portal. Thanks for your help. You got me pointed in the right direction. I only have need for the title and link, but left the other code in for reference.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
$.get("https://your-wordpress-site.edu/wp-login.php?redirect_to=feed&external=cas", function(data) {
var $XML = $(data);
$XML.find("item").each(function() {
var $this = $(this),
item = {
title: $this.find("title").text(),
link: $this.find("link").text(),
description: $this.find("description").text(),
pubDate: $this.find("pubDate").text(),
author: $this.find("author").text()
};
var alertList = $('<li/>').addClass('ui-menu-item').attr('role', 'menuitem');
var alertContent = $('<a>',{
text: $this.find("title").text(),
href: $this.find("link").text(),
class: 'row-alert',
}).appendTo(alertList);
alertList.appendTo('#displayAlerts');
});
});
</script>
<style>
#alertFeed {display:none;}
</style>
</head>
<body>
<iframe id="alertFeed" name="alertFeed" frameborder="0" src="http://www.lasalle.edu/alerts/wp-login.php?redirect_to=feed&external=cas"> Your browser does not support iframes.</iframe>
<ul id="displayAlerts"></ul>
</body>
</html