advertisement

Article:
  ASP.NET Forms Authentication - Part 1
Subject:   Emergency-Form level authentication
Date:   2004-06-03 09:02:25
From:   WayneSO
Response to: Emergency-Form level authentication

Mohsen,


I also need to allow access to all users on some pages in my applicaion while using forms authentication. Have you had any replies to your post or have you figured out how to do this?


Thanks,
Wayne

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Emergency-Form level authentication
    2004-06-10 16:38:26  altanic [Reply | View]

    look into the URLAuthorization stuff. I don't claim to have a solid handle on this but I've accomplished a working example on doing exactly what you guys ask for by setting each file/folder's authorization settings in the web.config file.

    You would want to add an element such as:
    <location path="PublicPage.aspx">
    <system.web>
    <authorization>
    <allow users="*"/>
    </authorization>
    </system.web>
    </location>

    for each item/folder you want to be freely available to everybody. Conversely, you could open your whole site to allow users="*" and then change the above to:

    <location path="protected_directory">
    <system.web>
    <authorization>
    <deny users="?"/>
    </authorization>
    </system.web>
    </location>

    so as to protect this one directory. (or page if you like)

    I think the key comes in understanding the <location> element and how it is used. Once you learn this you'll know enough.