ok, this problem occurs when you have ad intergrated into the DNN, basically the rss news feed can no longer read the feeds as it comes up with a 401 unauthrized access error.
comment out the line shown below in the web.config file and it works fine.
<!--
<add name="Authentication" type="DotNetNuke.HttpModules.AuthenticationModule, DotNetNuke.HttpModules.Authentication" /> -->
Now i thought maybe you could pass the credentails through to read the news feed but being a beginner like me im not sure if i have got it right or if this solution will work around the issue??
I have tested the code below and it works just the same if i dont use the credentails, ie works without ad authentication but not with.
code as follows:
<
script language="VB" runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
recentPosts.DataSource = GetRSSFeed(
http://webserver1/DotNetNuke/DesktopModules/Orizonti_NukeNews/getRSS.aspx?pid=0&tid=36&mid=465&cnt=5)
recentPosts.DataBind()
End Sub
Function GetRSSFeed(ByVal strURL As String) As DataTable
'Get the XML data
Dim resolver As XmlUrlResolver = New XmlUrlResolver()
Dim myCred As New Net.NetworkCredential
myCred =
New System.Net.NetworkCredential("username", "password", "domain")
Dim myRequest As Net.HttpWebRequest = System.Net.HttpWebRequest.Create(strURL)
myRequest.PreAuthenticate =
True
myRequest.Credentials = myCred 'Net.CredentialCache.DefaultCredentials
Dim myResponse As Net.HttpWebResponse = myRequest.GetResponse()
Dim responseStream As IO.Stream = myResponse.GetResponseStream()
Dim reader As XmlTextReader = New XmlTextReader(responseStream)
'Dim reader As New XmlTextReader(strURL)
'return a new DataSet
Dim ds As DataSet = New DataSet()
ds.ReadXml(reader)
Return ds.Tables(2)
End Function
</
script>
not really understand what is happening here im hoping someone can let me know if im wasting my time try to get this to work using code like above and if this is something that maybe able to be fixed?
Its a real shame because in an intranet envorment a rss news feed and ad authentication are both very important functions.
But hopefully there is a solution