locked
Asp.Net Forms Authentication in IIS 7 Issue RRS feed

  • Question

  • User-470999854 posted

    I'm testing an ASP.Net application that uses Forms Authentication on IIS 7.  (It's been running on Server 2003/IIS 6 for years).  The only issue I've run into is when an unauthenticated user navigates to the app they are redirected to the login.aspx as expected.  But the login page (Login.aspx) has links to .CSS and Images that aren't displaying for the user when not authenticated.  The CSS and images are in subdirectories of the app domain.  I have the following entries in my web.config which don't seem to be working under IIS 7. I've also configured the application pool to run in Integrated mode.  Any suggestions?

    web.config entry to images and style sheets

     <location path="Styles">
      <system.web>
       <authorization>
        <allow users="*" />
       </authorization>
      </system.web>
     </location>
     
     <location path="Images">
      <system.web>
       <authorization>
        <allow users="*" />
       </authorization>
      </system.web>
     </location>
    
    <authentication mode="Forms">
       <forms name="MyApp1" loginUrl="/app/logon.aspx" timeout="60" slidingExpiration="true">
       </forms>
      </authentication>
      <authorization>
       <deny users="?" />
      </authorization>
    Thursday, November 4, 2010 7:24 PM

Answers

  • User-1672167363 posted

    I'm testing an ASP.Net application that uses Forms Authentication on IIS 7.  (It's been running on Server 2003/IIS 6 for years).  The only issue I've run into is when an unauthenticated user navigates to the app they are redirected to the login.aspx as expected.  But the login page (Login.aspx) has links to .CSS and Images that aren't displaying for the user when not authenticated.  The CSS and images are in subdirectories of the app domain.  I have the following entries in my web.config which don't seem to be working under IIS 7. I've also configured the application pool to run in Integrated mode.  Any suggestions?

    web.config entry to images and style sheets

     <location path="Styles">
      <system.web>
       <authorization>
        <allow users="*" />
       </authorization>
      </system.web>
     </location>
     
     <location path="Images">
      <system.web>
       <authorization>
        <allow users="*" />
       </authorization>
      </system.web>
     </location>
    
    <authentication mode="Forms">
       <forms name="MyApp1" loginUrl="/app/logon.aspx" timeout="60" slidingExpiration="true">
       </forms>
      </authentication>
      <authorization>
       <deny users="?" />
      </authorization>

    Hello,

    The problem appears to be a problem with the permissions for the "IUSR" and "Anonmyus".

    You have to modify the folder and server permissions to allow access.

    The Web Server starts with folders and files are denied access until a user,account is provided proper permissions.

    Martin :)

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, January 3, 2011 11:05 PM

All replies

  • User-470999854 posted

    bump

    Friday, November 5, 2010 2:51 PM
  • User-470999854 posted

    bump bump

    Thursday, November 11, 2010 7:17 AM
  • User-470999854 posted

    Any body there?  Help please.

    Tuesday, December 21, 2010 10:02 PM
  • User-470999854 posted

    ?

    Monday, January 3, 2011 9:43 PM
  • User-1672167363 posted

    I'm testing an ASP.Net application that uses Forms Authentication on IIS 7.  (It's been running on Server 2003/IIS 6 for years).  The only issue I've run into is when an unauthenticated user navigates to the app they are redirected to the login.aspx as expected.  But the login page (Login.aspx) has links to .CSS and Images that aren't displaying for the user when not authenticated.  The CSS and images are in subdirectories of the app domain.  I have the following entries in my web.config which don't seem to be working under IIS 7. I've also configured the application pool to run in Integrated mode.  Any suggestions?

    web.config entry to images and style sheets

     <location path="Styles">
      <system.web>
       <authorization>
        <allow users="*" />
       </authorization>
      </system.web>
     </location>
     
     <location path="Images">
      <system.web>
       <authorization>
        <allow users="*" />
       </authorization>
      </system.web>
     </location>
    
    <authentication mode="Forms">
       <forms name="MyApp1" loginUrl="/app/logon.aspx" timeout="60" slidingExpiration="true">
       </forms>
      </authentication>
      <authorization>
       <deny users="?" />
      </authorization>

    Hello,

    The problem appears to be a problem with the permissions for the "IUSR" and "Anonmyus".

    You have to modify the folder and server permissions to allow access.

    The Web Server starts with folders and files are denied access until a user,account is provided proper permissions.

    Martin :)

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, January 3, 2011 11:05 PM
  • User-470999854 posted

    Thanks Martin!  I just had to add IUSER to the root directrory of the application.  that fixed it .  thanks so much!

    Thursday, January 6, 2011 5:07 PM
  • User-1672167363 posted

    Hello,

    I am gladd that you got it fixed.

    If that resolves the iisues could you mark the thread answered.

    We have posts / threads that are in limbo.

    Thanks,

    Martin :)

    Saturday, January 8, 2011 5:42 AM