rss feed protected with forms authentication

  • Thread starter Thread starter RMA
  • Start date Start date
R

RMA

Hello All,

Is it possible to add an rss feed (e.g. an .aspx page that writes xml
content to the response stream) to a forms authenticated web site? Anonymous
users shouldn't be able to read the contents of the page. Ideally the rss
reader would display the user for (forms authentication) credentials.

Is this possible? If yes, how?

TIA!

Roel
 
Hello All,

Is it possible to add an rss feed (e.g. an .aspx page that writes xml
content to the response stream) to a forms authenticated web site? Anonymous
users shouldn't be able to read the contents of the page. Ideally the rss
reader would display the user for (forms authentication) credentials.

Is this possible? If yes, how?

TIA!

Roel


In the folder, where the RSS feed is located, add a web.conig file
with the Authorization section

For example:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<location path="rss.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>

</configuration>
 
Alexey Smirnov said:
In the folder, where the RSS feed is located, add a web.conig file
with the Authorization section

For example:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<location path="rss.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>

</configuration>

But can I open the rss in a rss reader when it's forms authentication
protected? Where do I provide the credentials?
 
But can I open the rss in a rss reader when it's forms authentication
protected? Where do I provide the credentials?- Hide quoted text -

I think it depends on the reader, and you can test it using the
configuration I've sent you above. In my example, you should be
redirected to the login page. If a rss reader doesn't support redirect
and rendering the html of the login page, you should think about other
way - to generate a rss with the login link. Once the user clicked on
the link and has authenticated in another browser window, you will
generate a rss with the real content.

if (!HttpContext.Current.User.Identity.IsAuthenticated) {
.....generate rss with link to login page....
} else {
.....generate rss....
}
 
I think it depends on the reader, and you can test it using the
configuration I've sent you above. In my example, you should be
redirected to the login page. If a rss reader doesn't support redirect
and rendering the html of the login page, you should think about other
way - to generate a rss with the login link. Once the user clicked on
the link and has authenticated in another browser window, you will
generate a rss with the real content.

if (!HttpContext.Current.User.Identity.IsAuthenticated) {
....generate rss with link to login page....} else {

....generate rss....



}- Hide quoted text -

- Show quoted text -

another way is to consider the HTTP authentication
 
Back
Top