Forms-Based Security below Application Level

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Forms-Based Security below Application Level

    If I have a site where I want to use Forms-Based security but only on one or
    two SUB-directories of the Application root, I'm confused about how that
    works.

    Let's say I want wide-open annonymous access to the docroot and all of the
    sub-directories except for /SecureFolder1/* and /SecureFolder2/*. I'm
    confused about how I configure web.config to do this.

    Alex
    Alex Maghen Guest

  2. Similar Questions and Discussions

    1. Redirect after login based on Access Level
      Hi All I have been working through the tutorial on http://dmxzone.com/showDetail.asp?TypeId=28&NewsId=7645 to try and work out how to redirect a...
    2. Applying security at folder level using forms authentication
      Hi I have two folders in the .net application,one can be accessed by everyone adn the other needs to be accessed only through submitting login and...
    3. Forms based security
      Hi there, In forms based security do I have to arrange pages into subdirectories in order to secure them? I want the public to access my home page...
    4. Page Level role-based authentication
      I've set up and managed to use ASP.NET role-based authentication. I find the automatic checking and redirecting for unauthorized pages really...
    5. Page level, IP based security...
      I have a Web Project containing two WebForms and one WebService. What's the best way to limit who is able to access those three items? I want the...
  3. #2

    Default RE: Forms-Based Security below Application Level


    Hi Alex,

    You can very well do that.

    In your web.config of the root directory, just put the following code:-


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

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


    The above would deny anonymous access to only those files which are under
    the securefolder1 and securefolder2. If you want to deny access to everyone,
    make it to deny users=*, and if you want to deny particular user use deny
    user="username", for roles, deny roles="rolename", basically you can do all
    these settings at the web.config level.

    Write back if you have doubts.




    "Alex Maghen" wrote:
    > If I have a site where I want to use Forms-Based security but only on one or
    > two SUB-directories of the Application root, I'm confused about how that
    > works.
    >
    > Let's say I want wide-open annonymous access to the docroot and all of the
    > sub-directories except for /SecureFolder1/* and /SecureFolder2/*. I'm
    > confused about how I configure web.config to do this.
    >
    > Alex
    ranganh Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139