<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Security</title><link>http://forums.asp.net/25.aspx</link><description>All about ASP.NET security (authentication, authorization, membership, roles, etc.) and the Login controls. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=24&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Redirect an authenitcated user from a page to which they are denied access in the Web.config</title><link>http://forums.asp.net/thread/1904977.aspx</link><pubDate>Wed, 12 Sep 2007 14:05:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1904977</guid><dc:creator>ngruson</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1904977.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1904977</wfw:commentRss><description>&lt;p&gt;Hi Bob,&lt;/p&gt;
&lt;p&gt;Read this &lt;a href="http://flimflan.com/blog/HttpModuleToAllowACustomErrorPageFor4012AccessDeniedInASPNET.aspx"&gt;posting&lt;/a&gt; on how to redirect your unauthorized user to the an &amp;#39;access denied&amp;#39; page. I had the same problem and I solved it reading this.&lt;/p&gt;&lt;p&gt;Good luck!&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Redirect an authenitcated user from a page to which they are denied access in the Web.config</title><link>http://forums.asp.net/thread/1904924.aspx</link><pubDate>Wed, 12 Sep 2007 13:45:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1904924</guid><dc:creator>rvarcher</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1904924.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1904924</wfw:commentRss><description>&lt;p&gt;First, I thought that when the denied page was encountered by the logged-in user that .Net would redirect the user to the application&amp;#39;s forms authentication login page. But I guess that doesn&amp;#39;t happen because the user is already authenticated.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I also thought that maybe when the user tried to access a denied resource that the server would return a 403, so I tried to catch it in customErrors in Web.config. but that didn&amp;#39;t work either.&lt;/p&gt;&lt;p&gt;I&amp;#39;ve been thinking about it and I don&amp;#39;t know how much of a real world issue it will be. I was just looking for a more graceful way to handle it. I guess you could distill my question down to this - What to do when an authenticated user tries to access a page that they are denied access to?&lt;/p&gt;&lt;p&gt;&amp;nbsp;Thanks,&lt;/p&gt;&lt;p&gt;&amp;nbsp;- bob&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Redirect an authenitcated user from a page to which they are denied access in the Web.config</title><link>http://forums.asp.net/thread/1904363.aspx</link><pubDate>Wed, 12 Sep 2007 08:14:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1904363</guid><dc:creator>XiaoYong Dai – MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1904363.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1904363</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;rvarcher:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; 
&lt;p&gt;- An ~authenticated~ user NOT in the Allowed_User_Role tries to go to ~/MYDIR/mypage.aspx. I want to redirect this user somewhere and say, &amp;quot;Don&amp;#39;t do that.&amp;quot; This ~doesn&amp;#39;t~ work. &lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;
&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;For investigation, could you&amp;nbsp;provide more information about how you handle this&amp;nbsp;redirection&amp;nbsp;and display the message&amp;nbsp;to&amp;nbsp;user? Maybe we can find some clue.&lt;/p&gt;</description></item><item><title>Redirect an authenitcated user from a page to which they are denied access in the Web.config</title><link>http://forums.asp.net/thread/1901670.aspx</link><pubDate>Mon, 10 Sep 2007 20:58:15 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1901670</guid><dc:creator>rvarcher</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1901670.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1901670</wfw:commentRss><description>&lt;p&gt;In my web.config&lt;/p&gt;&lt;pre&gt;  &amp;lt;LOCATION path=&amp;quot;MYDIR&amp;quot;&amp;gt;
    &amp;lt;SYSTEM.WEB&amp;gt;
      &amp;lt;AUTHORIZATION&amp;gt;
        &amp;lt;DENY users=&amp;quot;*&amp;quot;&amp;gt;
        &amp;lt;ALLOW roles=&amp;quot;Allowed_User_Role&amp;quot;&amp;gt;
      &amp;lt;/AUTHORIZATION&amp;gt;
    &amp;lt;/SYSTEM.WEB&amp;gt;
  &amp;lt;/LOCATION&amp;gt;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;In my web.sitemap&lt;/p&gt;&lt;pre&gt;      &amp;lt;SITEMAPNODE title=&amp;quot;My Page&amp;quot; description=&amp;quot;My Page&amp;quot; url=&amp;quot;~/MYDIR/mypage.aspx&amp;quot; roles=&amp;quot;Allowed_User_Role&amp;quot; /&amp;gt;
&lt;/pre&gt;
&lt;p&gt;What I want to happen:&lt;/p&gt;
&lt;p&gt;- I don&amp;#39;t want the SiteMapNode in my TreeView to show to users not in the Allowed_User_Role. This works.&lt;/p&gt;
&lt;p&gt;- If an ~unauthenticated~ user goes to ~/MYDIR/mypage.aspx it redirects to the login page. This works.&lt;/p&gt;
&lt;p&gt;- An ~authenticated~ user in the Allowed_User_Role sees the SiteMapNode option in my TreeView and can successfully access ~/MYDIR/mypage.aspx. This also works.&lt;/p&gt;
&lt;p&gt;- An ~authenticated~ user NOT in the Allowed_User_Role does not see the SiteMapNode option in my TreeView. This works too.&lt;/p&gt;
&lt;p&gt;- An ~authenticated~ user NOT in the Allowed_User_Role tries to go to ~/MYDIR/mypage.aspx. I want to redirect this user somewhere and say, &amp;quot;Don&amp;#39;t do that.&amp;quot; This ~doesn&amp;#39;t~ work. I just get a &amp;quot;The page cannot be displayed&amp;quot; in IE and a &amp;quot;The page isn&amp;#39;t redirecting properly. Navigator has detected that the server is redirecting the request for this address in a way that will never complete.&amp;quot; in Netscape.&lt;/p&gt;
&lt;p&gt;Any ideas?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;- Bob Archer&lt;/p&gt;</description></item></channel></rss>