Note that there are some explanatory texts on larger screens.

plurals
  1. POAuthentication settings in IIS 7.5 and ASP.Net, what is difference?
    primarykey
    data
    text
    <p>I just start to learn web programming using IIS 7.5 in windows 2008 R2, and ASP.Net 4.</p> <p>I notice that both IIS and ASP.Net can define Authentication rules. In IIS, there is a form authentication setting where I can redirect user to specified page for authentication, like below:</p> <p><img src="https://i.stack.imgur.com/3R01F.jpg" alt="alt text"></p> <p>And then, in ASP web.config file, I find similar settings:</p> <pre><code>&lt;authentication mode="Forms"&gt; &lt;forms loginUrl="~/Account/Login.aspx" timeout="2880" /&gt; &lt;/authentication&gt; </code></pre> <p>When I finish both settings, I assume any page request will be redirect to the login.aspx page. But it didn't. So I am confused. How do the 2 sets of configs work together? And why page request is not redirected?</p> <p>Thanks</p> <p><strong>Update</strong></p> <p>Finally I get it working and I think I understand it now. My website structure is like below:</p> <p><img src="https://i.stack.imgur.com/KXwvr.jpg" alt="alt text"></p> <p>It is about modifying Autherization rules. Deny all unauthorized users for root:</p> <pre><code> &lt;authorization&gt; &lt;deny users="?" /&gt; &lt;/authorization&gt; </code></pre> <p>CSS files should be allowed for all users, so I have Styles\web.config:</p> <pre><code> &lt;authorization&gt; &lt;allow users="*" /&gt; &lt;/authorization&gt; </code></pre> <p>and only allow unauthorized users to access register.aspx, so I have Account\web.config:</p> <pre><code> &lt;location path="Register.aspx"&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;allow users="*"/&gt; &lt;/authorization&gt; &lt;/system.web&gt; &lt;/location&gt; &lt;system.web&gt; &lt;authorization&gt; &lt;deny users="?"/&gt; &lt;/authorization&gt; &lt;/system.web&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload