title: URL authorization failed for the request
body: <p>I am in the process of moving some sites over to a new windows 2003 installation running IIS6. However I am running into problems with forms authentication. The sites in question run fine on the old box which is the same OS and IIS version. </p>
  
  <p>When I try to login to the website I get a event log "URL authorization failed for the request" and the page redirects back to:-</p>
  
  <p><a href="http://www.demo.socialclause.net/logout.aspx?ReturnUrl=/Secure/Procurement/Default.aspx" rel="noreferrer">http://www.demo.socialclause.net/logout.aspx?ReturnUrl=/Secure/Procurement/Default.aspx</a></p>
  
  <p>Both the old and new servers contain the same set-up and the same permissions. Obviously I am missing a setting somewhere but cant fathom it out. Can anyone help?</p>
  
  <p>My web.config contains this:-</p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
    &lt;forms slidingExpiration="true" name=".ASPXAUTH" protection="All" loginUrl="~/logout.aspx" timeout="60" &gt;&lt;/forms&gt;
  &lt;/authentication&gt;
  </code></pre>
  
  <p>and inside the /secure dir (this is not a virtual directory) my web.config contains:-</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.web&gt;
      &lt;authorization&gt;
        &lt;allow roles="ClauseAdmin"/&gt;
        &lt;allow roles="ProcurementAdmin"/&gt;
        &lt;allow roles="ReportAdmin"/&gt;
        &lt;allow roles="SystemAdmin"/&gt;
        &lt;deny users="*"/&gt;
      &lt;/authorization&gt;
    &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The event log shows:</p>
  
  <pre><code>Event Type: Information
  Event Source:   ASP.NET 2.0.50727.0
  Event Category: Web Event 
  Event ID:   1314
  Date:       26/05/2009
  Time:       21:01:05
  User:       N/A
  Computer:   WILDEAA1
  Description:
  Event code: 4007 
  Event message: URL authorization failed for the request. 
  Event time: 26/05/2009 21:01:05 
  Event time (UTC): 26/05/2009 20:01:05 
  Event ID: af3bac34e6d74630b937a5a05d0f25f2 
  Event sequence: 4 
  Event occurrence: 1 
  Event detail code: 0 
  
  Application information: 
      Application domain: /LM/W3SVC/2067908276/Root-1-128878416581538912 
      Trust level: Full 
      Application Virtual Path: / 
      Application Path: C:\Inetpub\websites\www.demo.socialclause.net\htdocs\ 
      Machine name: WILDEAA1 
  
  Process information: 
      Process ID: 1076 
      Process name: w3wp.exe 
      Account name: NT AUTHORITY\NETWORK SERVICE 
  
  Request information: 
      Request URL: http://demo.socialclause.net/Secure/Procurement/Default.aspx 
      Request path: /Secure/Procurement/Default.aspx 
      User host address: 91.84.25.241 
      User: richard@wildesoft.net 
      Is authenticated: True 
      Authentication Type: Forms 
      Thread account name: NT AUTHORITY\NETWORK SERVICE 
  </code></pre>