members-only access to all files in a directory

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

  1. #1

    Default members-only access to all files in a directory

    I want to create a "member zone" with restricted access to registered
    members only.

    I already succeeded to restrict access to ASPX files in a particular
    directory using ASP.NET security.
    I use Forms authentication and the <location> tag in web.config.

    Is it possible with ASP.NET to apply the same restriction to all files (with
    extension HTM, HTML, JPG, etc...) within a given directory?

    --

    Jos


    Jos Guest

  2. Similar Questions and Discussions

    1. Active Directory Groups - more than 1000 members
      I?ve been polling the ?member? attribute of Active Directory (AD) groups for some time and I came across a new obstacle. Groups with more than 1000...
    2. Giving Access to files in a directory
      I have this script that checks user permissions in a database table and gives users access to files in a directory on the server. At the moment it...
    3. Giving users access to certain files in a directory
      Ok here is my problem. We have a directory of excel files and users can only look at files they have been assigned permissions for, all the files...
    4. Server cannot access application directory ... The directory does not exist or is not accessible because of security settings
      If you are using Windows XP in a Workgroup, rather than a Domain, then by default "Simple Filesharing" is turned on, and you won't see a security...
    5. Server cannot access application directory... The directory does not exist or is not accessible because of security settings.
      Hi, I have this issue with the error below. Let me explain my goal and my server environement: Goal: To have 3 separate web servers reading...
  3. #2

    Default Re: members-only access to all files in a directory

    You wouldn't do that with your web.config settings. Why? Because web.config
    is read by the ASP.NET runtime, which is invoked depending on the file
    extension. You could remap the other file extensions to the ASP.NET handler
    (I honestly don't know what the outcome of this would be, but it is worth a
    shot?) so they pick up the security - the only thing that might go wrong is
    that the handler might not know what to do with these files. If you are
    using Windows Authentication, you can just set this up using NTFS
    permissions and not worry about that.

    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows Client
    Windows XP Associate Expert
    --
    More people read the newsgroups than read my email.
    Reply to the newsgroup for a faster response.
    (Control-G using Outlook Express)
    --

    "Jos" <josnospambranders@fastmail.fm> wrote in message
    news:uszfT1t8DHA.2168@TK2MSFTNGP12.phx.gbl...
    >I want to create a "member zone" with restricted access to registered
    > members only.
    >
    > I already succeeded to restrict access to ASPX files in a particular
    > directory using ASP.NET security.
    > I use Forms authentication and the <location> tag in web.config.
    >
    > Is it possible with ASP.NET to apply the same restriction to all files
    > (with
    > extension HTM, HTML, JPG, etc...) within a given directory?
    >
    > --
    >
    > Jos
    >
    >

    Chris Jackson Guest

  4. #3

    Default Re: members-only access to all files in a directory

    Yes - you can map other extensions (you can even specify .*) in the web site mappings
    You could then write a HttpHandler that will intercept all requests and implement your access control logic


    richlm Guest

  5. #4

    Default Re: members-only access to all files in a directory

    > Yes - you can map other extensions (you can even specify .*) in the web
    > site mappings.
    > You could then write a HttpHandler that will intercept all requests and
    > implement your access control logic.
    But will it handle file types like html and jpg without writing such a
    handler, just by passing them through? Or will this person need to implement
    a handler to do this passthrough?

    --
    Chris Jackson
    Software Engineer
    Microsoft MVP - Windows Client
    Windows XP Associate Expert
    --
    More people read the newsgroups than read my email.
    Reply to the newsgroup for a faster response.
    (Control-G using Outlook Express)
    --


    Chris Jackson Guest

  6. #5

    Default Re: members-only access to all files in a directory

    It passes through OK with no additional programming effort for static
    files - i.e. ones with IE understands - jpg, txt, htm, .... (but not .asp)
    So you should NOT need a HttpHandler (or a HttpModule) to do the
    passthrough.

    BUT I am not sure that the ASP.NET security checks (defined in web.config)
    are made in all cases - e.g. it looks like .jpg are covered, but for .htm
    you still get the page even if you should be denied access (on XP). So you
    would perhaps still need a HttpHandler/Module to pre-process the request and
    decide whether or not to pass it on or reject it.

    Richard.

    "Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
    news:uLWhZHl9DHA.340@tk2msftngp13.phx.gbl...
    > > Yes - you can map other extensions (you can even specify .*) in the web
    > > site mappings.
    > > You could then write a HttpHandler that will intercept all requests and
    > > implement your access control logic.
    >
    > But will it handle file types like html and jpg without writing such a
    > handler, just by passing them through? Or will this person need to
    implement
    > a handler to do this passthrough?
    >
    > --
    > Chris Jackson
    > Software Engineer
    > Microsoft MVP - Windows Client
    > Windows XP Associate Expert
    > --
    > More people read the newsgroups than read my email.
    > Reply to the newsgroup for a faster response.
    > (Control-G using Outlook Express)
    > --
    >
    >

    richlm 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