<?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: set multiple loginurl for nested folders?</title><link>http://forums.asp.net/thread/2183224.aspx</link><pubDate>Tue, 19 Feb 2008 23:17:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2183224</guid><dc:creator>mayankagarwal</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2183224.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2183224</wfw:commentRss><description>&lt;p&gt;Tell me if I am right in thinking...&lt;/p&gt;
&lt;p&gt;Wouldnt this need to be done on every page in the secure folder?&lt;/p&gt;
&lt;p&gt;And this method assumes that ther is only one login page that directs the request. but i waas thinking to kave individual login pages inside the secure folders?&lt;/p&gt;
&lt;p&gt;so if anyone tried to navigate directly to say MasterAdmin\aaa.aspx they will see a login page within the MasterAdmin folder and so and so forth.&lt;/p&gt;
&lt;p&gt;in your previous example you are using appsetting with Key &amp;#39;FolderName&amp;#39; i wonder what is that used for?&lt;/p&gt;
&lt;p&gt;Thanks for you help...&lt;/p&gt;</description></item><item><title>Re: set multiple loginurl for nested folders?</title><link>http://forums.asp.net/thread/2182779.aspx</link><pubDate>Tue, 19 Feb 2008 19:19:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2182779</guid><dc:creator>izeman</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2182779.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2182779</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;You can also do this directly in CB in your login page&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;span class="cmt"&gt;//REDIRECTION AFTER LOGIN BASED ON USER ROLE&lt;/span&gt;
    &lt;span class="kwd"&gt;protected void&lt;/span&gt; mainLogin_LoggedIn(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, EventArgs e)
    {
        &lt;span class="kwd"&gt;if&lt;/span&gt;(Roles.IsUserInRole(mainLogin.UserName, &lt;span class="st"&gt;&amp;quot;MasterAdmin&amp;quot;&lt;/span&gt;))
        {
           Response.Redirect(&lt;span class="st"&gt;&amp;quot;~/MasterAdmin/Default.aspx&amp;quot;&lt;/span&gt;);
        }
        &lt;span class="kwd"&gt;else if&lt;/span&gt;(Roles.IsUserInRole(mainLogin.UserName, &lt;span class="st"&gt;&amp;quot;CustomerAdmin&amp;quot;&lt;/span&gt;))
        {
            Response.Redirect(&lt;span class="st"&gt;&amp;quot;~/CustomerAdmin/Default.aspx&amp;quot;&lt;/span&gt;);
        }
        &lt;span class="kwd"&gt;else if&lt;/span&gt; (Roles.IsUserInRole(mainLogin.UserName, &lt;span class="st"&gt;&amp;quot;User&amp;quot;&lt;/span&gt;))
        {
            Response.Redirect(&lt;span class="st"&gt;&amp;quot;~/User/Default.aspx&amp;quot;&lt;/span&gt;);
        }
        &lt;span class="kwd"&gt;else&lt;/span&gt;
        {
            Response.Redirect(&lt;span class="st"&gt;&amp;quot;~/Default.aspx&amp;quot;&lt;/span&gt;);
        }
    }&lt;/pre&gt;&amp;nbsp;&amp;nbsp;</description></item><item><title>Re: set multiple loginurl for nested folders?</title><link>http://forums.asp.net/thread/2181446.aspx</link><pubDate>Tue, 19 Feb 2008 06:57:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2181446</guid><dc:creator>mayankagarwal</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2181446.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2181446</wfw:commentRss><description>&lt;p&gt;Hi this seems to be a very good idea. i tried it on one folder and it working in essence. Are you able to provide a bit more elaborate example on how i can achieve this on 3 difference folders please&lt;/p&gt;</description></item><item><title>Re: set multiple loginurl for nested folders?</title><link>http://forums.asp.net/thread/2136674.aspx</link><pubDate>Mon, 28 Jan 2008 11:22:18 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2136674</guid><dc:creator>XiaoYong Dai – MSFT</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2136674.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2136674</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I suggest you don&amp;#39;t restrict page in web.config using&amp;nbsp;authorization section. Instead, you can handle the authorization in page_load event, then redirect to whatever page you want. If you don&amp;#39;t like the hard coded way, what about store the rule in &amp;lt;appSettings&amp;gt;&lt;/p&gt;
&lt;p&gt;e.g:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;appSettings&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;add key=&amp;quot;FolderName&amp;quot; value=&amp;quot;Admin&amp;quot; /&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &amp;lt;add key=&amp;quot;LoginUrl&amp;quot; value=&amp;quot;Admin\login.aspx&amp;quot; /&amp;gt; &lt;/p&gt;
&lt;p&gt;&amp;lt;/appSettings&amp;gt;&lt;/p&gt;
&lt;p&gt;--------------read in code behind------------&lt;/p&gt;
&lt;p&gt;if (! User.IsInRole(&amp;quot;ClauseAdmin&amp;quot;)) { &lt;/p&gt;
&lt;p&gt;&amp;nbsp; string FoerName= ConfigurationSettings.AppSettings[&amp;quot;LoginUrl&amp;quot;];&lt;br /&gt;&amp;nbsp; Response.Redirect(FoerName);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;</description></item><item><title>Re: set multiple loginurl for nested folders?</title><link>http://forums.asp.net/thread/2135496.aspx</link><pubDate>Sun, 27 Jan 2008 19:11:32 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2135496</guid><dc:creator>Rippo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2135496.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2135496</wfw:commentRss><description>&lt;p&gt;Has anyone successfully done this? Is this impossible&lt;br /&gt;I suppose I will have to think of a work around.&lt;/p&gt;&lt;p&gt;Thanks Rippo&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>set multiple loginurl for nested folders?</title><link>http://forums.asp.net/thread/2132821.aspx</link><pubDate>Fri, 25 Jan 2008 14:25:24 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2132821</guid><dc:creator>Rippo</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2132821.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=2132821</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Is it possible to specify in the web.config file in each folder that requires forms authentication which page the user should be redirected to if they do not have the correct permissions.&lt;br /&gt;&lt;br /&gt;e.g&lt;br /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Admin folder (redirect to ~/logout.aspx)&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;Report Admin (redirect to ~/permission.aspx)&lt;/li&gt;
&lt;li&gt;Stats Admin (redirect to ~/permission.aspx&amp;quot;)&lt;br /&gt; &amp;nbsp;&amp;nbsp; &amp;nbsp; etc  &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;br /&gt;in my root web.config I have...&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre class="coloredcode"&gt;&amp;lt;&lt;span class="tag"&gt;authentication&lt;/span&gt;&lt;span class="attr"&gt; mode=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;Forms&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;      &amp;lt;&lt;span class="tag"&gt;forms&lt;/span&gt;&lt;span class="attr"&gt; loginUrl=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;~/logout.aspx&amp;quot;&lt;/span&gt; ...&amp;gt;&amp;lt;/&lt;span class="tag"&gt;forms&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span class="tag"&gt;authentication&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;/pre&gt;&amp;nbsp;&lt;br /&gt;in each web.config in each sub folder I have&amp;nbsp; &lt;br /&gt;
&lt;pre class="coloredcode"&gt;&amp;lt;&lt;span class="tag"&gt;configuration&lt;/span&gt;&amp;gt;&lt;br /&gt;  &amp;lt;&lt;span class="tag"&gt;system.web&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;span class="tag"&gt;authorization&lt;/span&gt;&amp;gt;&lt;br /&gt;      &amp;lt;&lt;span class="tag"&gt;allow&lt;/span&gt;&lt;span class="attr"&gt; roles=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;ClauseAdmin&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;      &amp;lt;&lt;span class="tag"&gt;deny&lt;/span&gt;&lt;span class="attr"&gt; users=&lt;/span&gt;&lt;span class="attrv"&gt;&amp;quot;*&amp;quot;&lt;/span&gt;/&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;span class="tag"&gt;authorization&lt;/span&gt;&amp;gt;&lt;br /&gt;  &amp;lt;/&lt;span class="tag"&gt;system.web&lt;/span&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;span class="tag"&gt;configuration&lt;/span&gt;&amp;gt;&lt;br /&gt;&lt;/pre&gt;&amp;nbsp;
    and I am hoping to specify the&amp;nbsp; loginurl. How can I do this?&lt;br /&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;br /&gt;</description></item></channel></rss>