Index: src/Plugins/Banshee.Plugins.Podcast/PodcastLibrary.cs
===================================================================
--- src/Plugins/Banshee.Plugins.Podcast/PodcastLibrary.cs	(revision 2760)
+++ src/Plugins/Banshee.Plugins.Podcast/PodcastLibrary.cs	(working copy)
@@ -765,7 +765,7 @@
                     }
                     else
                     {
-                        feed = new PodcastFeedInfo (key);
+                        feed = new PodcastFeedInfo (key,null,null);
                         AddPodcastFeed (feed);
                     }
                 }
Index: src/Plugins/Banshee.Plugins.Podcast/FeedUtils.cs
===================================================================
--- src/Plugins/Banshee.Plugins.Podcast/FeedUtils.cs	(revision 2760)
+++ src/Plugins/Banshee.Plugins.Podcast/FeedUtils.cs	(working copy)
@@ -58,7 +58,7 @@
         }
 
         // -- Adapted from Monopod
-        public static XmlDocument FetchXmlDocument (string uri, DateTime lastUpdated)
+        public static XmlDocument FetchXmlDocument (string uri, string username, string password, DateTime lastUpdated)
         {
             HttpWebResponse resp = null;
 
@@ -66,7 +66,7 @@
             {
                 string xmltext;
 
-                resp = GetURI (uri, lastUpdated);
+                resp = GetURI (uri, username, password, lastUpdated);
 
                 if (resp == null)
                 {
@@ -115,13 +115,19 @@
         }
 
         // -- Adapted from Monopod
-        public static HttpWebResponse GetURI (string uri, DateTime lastUpdated)
+        public static HttpWebResponse GetURI (string uri, string username, string password,DateTime lastUpdated)
         {
             HttpWebRequest request = (HttpWebRequest) WebRequest.Create (uri);
+            
+            if (username != null)
+            {
+                request.Credentials = new NetworkCredential(username,(password==null?"":password));
+            }
+            
             request.Timeout = (30 * 1000); // 30 seconds
             request.UserAgent = "Banshee"; // Should be a global
             request.IfModifiedSince = lastUpdated;
-
+            
             return (HttpWebResponse) request.GetResponse ();
         }
 
Index: src/Plugins/Banshee.Plugins.Podcast/PodcastFeedInfo.cs
===================================================================
--- src/Plugins/Banshee.Plugins.Podcast/PodcastFeedInfo.cs	(revision 2760)
+++ src/Plugins/Banshee.Plugins.Podcast/PodcastFeedInfo.cs	(working copy)
@@ -101,7 +101,9 @@
     {
         private int feed_id;
         private Uri feed_url;
-
+        private string username;
+        private string password;
+        
         private string title;
 
         // TODO Link & Image should be of type System.Uri.
@@ -177,11 +179,13 @@
 
         private PodcastFeedInfo () {}
 
-        public PodcastFeedInfo (int id, string feedUrl, bool subscribed, SyncPreference sync)
+        public PodcastFeedInfo (int id, string feedUrl, bool subscribed, SyncPreference sync,string username,string password)
         {
             feed_id = id;
             feed_url = new Uri (feedUrl);
             this.subscribed = subscribed;
+            this.username = username;
+            this.password = password;
             sync_preference = sync;
 
             podcasts = new ArrayList ();
@@ -189,8 +193,8 @@
 
         public PodcastFeedInfo (int id, string title, string feedUrl, string link,
                                 string description, string image, DateTime lastUpdate, bool subscribed,
-                                SyncPreference sync)
-                : this (id, feedUrl, subscribed, sync)
+                                SyncPreference sync,string username,string password)
+                : this (id, feedUrl, subscribed, sync,username,password)
         {
             this.title = title;
             this.description = description;
@@ -199,9 +203,9 @@
             this.lastUpdate = lastUpdate;
         }
 
-        public PodcastFeedInfo (string url) : this (0, url, true, SyncPreference.One) {}
-        public PodcastFeedInfo (string url, SyncPreference sync)
-                : this (0, url, true, sync) {}
+        public PodcastFeedInfo (string url,string username,string password) : this (0, url, true, SyncPreference.One,username,password) {}
+        public PodcastFeedInfo (string url, SyncPreference sync,string username,string password)
+                : this (0, url, true, sync,username,password) {}
 
         public void Add (PodcastInfo pi)
         {
@@ -408,7 +412,7 @@
             {
                 XmlDocument doc;
 
-                doc = FeedUtil.FetchXmlDocument (feed_url.ToString ().Trim(), lastUpdate);
+                doc = FeedUtil.FetchXmlDocument (feed_url.ToString ().Trim(),username,password, lastUpdate);
 
                 if (doc == null)
                 {
@@ -514,7 +518,7 @@
                 PodcastCore.Library.RemovePodcasts (zombie_podcasts);
                 updated = true;
             }
-
+            
             if (updated)
             {
                 EmitFeedUpdated (new_podcasts, zombie_podcasts);
@@ -726,6 +730,30 @@
             }
         }
 
+        public string Username {
+            get 
+            {
+                return this.username;
+            }
+            set 
+            {
+                this.username = value;
+            }
+        }
+        
+        public string Password {
+            get {
+                return this.password;
+            }
+            set { this.password = value; }
+        }
+        
+        public bool HasLoginCredentials {
+            get {
+                return (this.username != null || this.username != "");
+            }
+        }
+        
         public Uri Url {
             get
             {
Index: src/Plugins/Banshee.Plugins.Podcast/PodcastDBManager.cs
===================================================================
--- src/Plugins/Banshee.Plugins.Podcast/PodcastDBManager.cs	(revision 2760)
+++ src/Plugins/Banshee.Plugins.Podcast/PodcastDBManager.cs	(working copy)
@@ -29,6 +29,7 @@
 using System.Data;
 using System.Text;
 using System.Collections;
+using Gnome.Keyring;
 
 using Banshee.Base;
 using Banshee.Database;
@@ -98,9 +99,10 @@
                     feed_reader.GetString (2), GetStringSafe (feed_reader, 3),
                     GetStringSafe (feed_reader, 4), GetStringSafe (feed_reader, 5),
                     GetDateTimeSafe (feed_reader, 6), feed_reader.GetBoolean (7),
-                    (SyncPreference)feed_reader.GetInt32(8)
+                    (SyncPreference)feed_reader.GetInt32(8),null,null
                 );
                 
+                PodcastDBManager.GetAuthentication(ref feed);
                 podcastFeeds.Add (feed);
                 feed.Add (LoadPodcasts (feed));
             }
@@ -198,6 +200,8 @@
                                                   ));
             }
 
+            PodcastDBManager.SaveAuthentication(feed);
+            
             return ret;
         }
 
@@ -354,6 +358,48 @@
             Globals.Library.Db.Execute(query_builder.ToString ());
         }
         
+        private static void GetAuthentication(ref PodcastFeedInfo info)
+        {
+            
+            Hashtable attribs = new Hashtable();                              
+            attribs["name"] = info.Url.ToString();
+            
+            foreach(ItemData res in Ring.Find(ItemType.NetworkPassword,attribs))
+            {
+                if(res.Attributes["name"] as string != info.Url.ToString())
+                    continue;
+                
+                info.Username = (res.Attributes["user"] as string).Trim();
+                info.Password = res.Secret.Trim();
+                break;    
+            }
+            
+        }
+                
+        private static void SaveAuthentication(PodcastFeedInfo info)
+        {
+            if (!info.HasLoginCredentials)
+                return;
+            
+            Hashtable attribs = new Hashtable();
+            attribs["name"] = info.Url.ToString();
+            ItemData[] items = Ring.Find(ItemType.NetworkPassword,attribs);
+            
+            String keyring = Ring.GetDefaultKeyring();
+            attribs["user"] = info.Username;
+            
+            if (items.Length == 0)
+            {
+                Ring.CreateItem(keyring,ItemType.NetworkPassword,info.Url.ToString(),attribs,info.Password,true);
+            }
+            else
+            {
+                Ring.SetItemInfo(keyring,items[0].ItemID,ItemType.NetworkPassword,info.Url.ToString(),info.Password);
+                Ring.SetItemAttributes(keyring,items[0].ItemID,attribs);
+            }
+
+        }
+        
         private static string GetStringSafe (IDataReader reader, int index)
         {
             return reader.IsDBNull (index) ? 
Index: src/Plugins/Banshee.Plugins.Podcast/FeedParsers/PodcastFeedParser.cs
===================================================================
--- src/Plugins/Banshee.Plugins.Podcast/FeedParsers/PodcastFeedParser.cs	(revision 2760)
+++ src/Plugins/Banshee.Plugins.Podcast/FeedParsers/PodcastFeedParser.cs	(working copy)
@@ -57,7 +57,7 @@
             {
                 throw new ArgumentNullException ("doc");
             }
-            else if (doc == null)
+            else if (feed == null)
             {
                 throw new ArgumentNullException ("feed");
             }
Index: src/Plugins/Banshee.Plugins.Podcast/Makefile.am
===================================================================
--- src/Plugins/Banshee.Plugins.Podcast/Makefile.am	(revision 2760)
+++ src/Plugins/Banshee.Plugins.Podcast/Makefile.am	(working copy)
@@ -35,7 +35,7 @@
 all: $(ASSEMBLY)
 
 $(ASSEMBLY): $(SOURCES) data/PodcastMenu.xml
-	$(BUILD_LIB_BANSHEE_CORE) -out:$@ -r:System.Data -r:System.Web -r:System.Xml $(podcast_resources_build) $(LINK_GTK) $(LINK_MONO_UNIX) $(SOURCES)
+	$(BUILD_LIB_BANSHEE_CORE) -out:$@ -r:System.Data -r:System.Web -r:System.Xml $(LINK_GNOME_KEYRING) $(podcast_resources_build) $(LINK_GTK) $(LINK_MONO_UNIX) $(SOURCES)
 
 include $(top_srcdir)/build/gconf-schema-rules
 
Index: src/Plugins/Banshee.Plugins.Podcast/PodcastCore.cs
===================================================================
--- src/Plugins/Banshee.Plugins.Podcast/PodcastCore.cs	(revision 2760)
+++ src/Plugins/Banshee.Plugins.Podcast/PodcastCore.cs	(working copy)
@@ -419,7 +419,7 @@
                 {
                     // CreateUri should be in PodcastFeedInfo
                     feedUri = PodcastFeedFetcher.CreateUri (url);
-                    SubscribeToPodcastFeed (feedUri.ToString (), sync);
+                    SubscribeToPodcastFeed (feedUri.ToString (), sync,subscribe_dialog.Username,subscribe_dialog.Password);
                 }
                 catch (NotSupportedException)
                 {
@@ -451,9 +451,9 @@
             }
         }
 
-        internal static void SubscribeToPodcastFeed (string uri, SyncPreference sync)
+        internal static void SubscribeToPodcastFeed (string uri, SyncPreference sync,string username,string password)
         {
-            PodcastFeedInfo feed = new PodcastFeedInfo (uri, sync);
+            PodcastFeedInfo feed = new PodcastFeedInfo (uri, sync,username,password);
 
             feed.UpdateFinished += InitialFeedUpdateHandler;
 
Index: src/Plugins/Banshee.Plugins.Podcast/UI/PodcastFeedPropertiesDialog.cs
===================================================================
--- src/Plugins/Banshee.Plugins.Podcast/UI/PodcastFeedPropertiesDialog.cs	(revision 2760)
+++ src/Plugins/Banshee.Plugins.Podcast/UI/PodcastFeedPropertiesDialog.cs	(working copy)
@@ -41,7 +41,9 @@
     {
         private PodcastFeedInfo feed;
         private SyncPreferenceComboBox new_episode_option_combo;
-
+        private Entry username_entry;
+        private Entry password_entry;
+        
         public PodcastFeedPropertiesDialog (PodcastFeedInfo feed) :
                 base (feed.Title, InterfaceElements.MainWindow, DialogFlags.DestroyWithParent)
         {
@@ -67,7 +69,7 @@
             HBox content_box = new HBox();
             content_box.Spacing = 12;
 
-            Table table = new Table (2, 4, false);
+            Table table = new Table (2, 6, false);
             table.RowSpacing = 6;
             table.ColumnSpacing = 12;
 
@@ -86,6 +88,17 @@
             feed_url_label.SetAlignment (0f, 0f);
             feed_url_label.Justify = Justification.Left;
 
+            Label username_label = new Label ();
+            username_label.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(Catalog.GetString ("Username:")));
+            username_label.SetAlignment (0f, 0f);
+            username_label.Justify = Justification.Left;
+            
+            Label password_label = new Label ();
+            password_label.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(Catalog.GetString ("Password:")));
+            password_label.SetAlignment (0f, 0f);
+            password_label.Justify = Justification.Left;
+            
+            
             Label new_episode_option_label = new Label ();
             new_episode_option_label.Markup = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(Catalog.GetString (
                                                   "When feed is updated:")));
@@ -156,6 +169,15 @@
                 description_label, 0, 1, 3, 4,
                 AttachOptions.Fill, AttachOptions.Fill, 0, 0
             );
+            table.Attach (
+                username_label, 0, 1, 4, 5,
+                AttachOptions.Fill, AttachOptions.Fill, 0, 0
+            );
+            
+            table.Attach (
+                password_label, 0, 1, 5, 6,
+                AttachOptions.Fill, AttachOptions.Fill, 0, 0
+            );
 
             table.Attach (
                 feed_url_text, 1, 2, 0, 1,
@@ -177,6 +199,21 @@
                           AttachOptions.Expand | AttachOptions.Fill, 0, 0
                          );
 
+            username_entry = new Entry(feed.Username);
+            password_entry = new Entry(feed.Password);
+            //XXX bug in libgtk2.0-cil 2.10: if text is hidden, Entry.Text is always an empty string
+            //password_entry.Visibility = false;
+            
+            table.Attach (
+                username_entry, 1, 2, 4, 5,
+                AttachOptions.Fill, AttachOptions.Fill, 0, 0
+            );
+
+            table.Attach (
+                password_entry, 1, 2, 5, 6,
+                AttachOptions.Fill, AttachOptions.Fill, 0, 0
+            );
+
             content_box.PackStart (table, true, true, 0);
             box.PackStart (content_box, true, true, 0);
 
@@ -206,11 +243,29 @@
 
             if (args.ResponseId == Gtk.ResponseType.Ok)
             {
+                bool has_changes = false;
+
+                if (feed.Username != username_entry.Text)
+                {
+                    has_changes = true;
+                    feed.Username = username_entry.Text;
+                }
+
+                if (feed.Password != password_entry.Text)
+                {
+                    has_changes = true;
+                    feed.Password = password_entry.Text;
+                }
+                
                 SyncPreference new_sync_pref = new_episode_option_combo.ActiveSyncPreference;
-
                 if (feed.SyncPreference != new_sync_pref)
                 {
+                    has_changes = true;
                     feed.SyncPreference = new_sync_pref;
+                }
+
+                if (has_changes)
+                {
                     feed.Commit ();
 
                     if (new_sync_pref != SyncPreference.None &&
Index: src/Plugins/Banshee.Plugins.Podcast/UI/PodcastSubscribeDialog.cs
===================================================================
--- src/Plugins/Banshee.Plugins.Podcast/UI/PodcastSubscribeDialog.cs	(revision 2760)
+++ src/Plugins/Banshee.Plugins.Podcast/UI/PodcastSubscribeDialog.cs	(working copy)
@@ -39,6 +39,8 @@
     internal class PodcastSubscribeDialog : Dialog
     {
         private Entry url_entry;
+        private Entry username_entry;
+        private Entry password_entry;
         SyncPreferenceComboBox sync_combo;
         private Gtk.AccelGroup accel_group;
 
@@ -86,11 +88,8 @@
             message.SetAlignment (0.0f, 0.0f);
 
             Expander advanced_expander = new Expander ("Advanced");
-
-            VBox expander_children = new VBox();
-            expander_children.BorderWidth = 6;
-            expander_children.Spacing = 6;
-
+            VBox expander_container = new VBox();
+            
             Label sync_text = new Label (Catalog.GetString (
                                              "When new episodes are available:  "));
             sync_text.SetAlignment (0.0f, 0.0f);
@@ -98,11 +97,50 @@
 
             sync_combo = new SyncPreferenceComboBox ();
 
-            expander_children.PackStart (sync_text);
-            expander_children.PackStart (sync_combo);
+            VBox sync_box = new VBox();
+            sync_box.BorderWidth = 6;
+            sync_box.Spacing = 6;
+            sync_box.PackStart (sync_text);
+            sync_box.PackStart (sync_combo);
+            
+            expander_container.Add(sync_box);
 
-            advanced_expander.Add (expander_children);
+            /* username and password */
+            
+            Label label = new Label (Catalog.GetString ("Username:  "));
+            sync_text.SetAlignment (0.0f, 0.0f);
+            sync_text.Justify = Justification.Left;
 
+            username_entry = new Entry();
+
+            HBox username_box = new HBox();
+            username_box.BorderWidth = 6;
+            username_box.Spacing = 6;
+            username_box.PackStart (label);
+            username_box.PackStart (username_entry);            
+            
+            expander_container.Add(username_box);
+            
+            label = new Label (Catalog.GetString ("Password:  "));
+            sync_text.SetAlignment (0.0f, 0.0f);
+            sync_text.Justify = Justification.Left;
+
+            password_entry = new Entry();
+            //XXX bug in libgtk2.0-cil 2.10: if text is hidden, Entry.Text is always an empty string
+            //password_entry.Visibility=false;
+
+            HBox password_box = new HBox();
+            password_box.BorderWidth = 6;
+            password_box.Spacing = 6;
+            password_box.PackStart (label);
+            password_box.PackStart (password_entry);            
+            
+            expander_container.Add(password_box);
+            
+            /* end of username and password */
+            
+            advanced_expander.Add (expander_container);
+            
             url_entry = new Entry ();
             url_entry.ActivatesDefault = true;
 
@@ -152,6 +190,16 @@
             }
         }
 
+        public string Username {
+            get { return username_entry.Text;}
+            set { username_entry.Text = value; }
+        }
+        
+        public string Password {
+            get { return password_entry.Text; }
+            set { password_entry.Text = value; }
+        }
+        
         public string Url {
             get
             {

