Forms Authetication to Protect Single File Using Asp.net

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

  1. #1

    Default Forms Authetication to Protect Single File Using Asp.net

    I want to protect a single file (openvideo.aspx). I already setup the
    folder as an application in IIS.
    The authentication seems to work fine and the permissions works as it
    should.

    The problem comes after the user gets authenticated. I need to store
    each user info in database after it gets authenticated at any time,
    not only the first time.
    I am using persistent cookie. It seems that register.aspx it's being
    bypassed or skipped after authentication and I can't force the
    register.aspx (loginUrl) to be checked after authentication.

    I tryed using Request.IsAuthenticated but it always returns false.
    From my little understanting of .net framework, I thinks something is
    happening behind that is taking control of cookie authentication and
    using session instead.

    <configuration>
    <system.web>
    <authentication mode="Forms" >
    <forms loginUrl="register.aspx" name=".AUTH1" protection="None"
    path="/" timeout="20" >
    </forms>
    </authentication>
    </system.web>

    <location path="openvideo.aspx">
    <system.web>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    </location>
    </configuration>

    thanks

    Rod
    rodrigo Guest

  2. Similar Questions and Discussions

    1. Can I password-protect a PDF file?
      I'm trying to set up a site with a 'members-only' area that contains PDF files. Is there some way to password-protect the files themselves, or do I...
    2. Forms Authentication - Single Sign-On
      I am implementing a single sign-on system in ASP.Net. The technique I am using is as defined by Paul Sheriff, in the MSDN article Single Sign-On...
    3. Forms Authentication to protect a cgi application
      I have enabled forms authentication on an IIS 6 W2k3 server to protect access to the application files until authenticated. The actual...
    4. Forms Authentication to protect .cgi application problem
      I have enabled forms authentication on an IIS 6 W2k3 server to protect access to the application files until authenticated. The actual...
    5. Forms Authentication doesn't protect specified pages.
      This is driving me nuts: I've used this same exact setup (web.config, see below) before without any problems... the authentication does not stop...
  3. #2

    Default Re: Forms Authetication to Protect Single File Using Asp.net

    Let me clarify better my situation.

    login page = register.aspx
    protected page = openvideo.aspx

    SIMULATION
    (First time access. No cookies yet)

    1. Try to access openvideo.aspx
    2. Asp.Net checks web.config permissions
    3. It is protected, then redirects to register.aspx
    4. User informs name and password and submit back to register.aspx
    5. register.aspx validates user in database and redirects to
    authorizes openvideo.asp page
    6. Cookie is persistent
    7. Close the brower and try to access openvideo.aspx
    8. Asp.Net checks web.config permissions. It is protected, but this
    time do not redirect to register.aspx since it is authenticated.
    9. Asp.Net just lets the user see the file content.
    10. Clean cookies
    11. Things repeat like first step

    With this situation I can't force tracking of info at all times even
    after authentication.

    The point is I need track user info (querystring, time, etc) each time
    he access openvideo.aspx because register.aspx does not ge hit after
    authentication.

    You suggestion to get rid of persistent cookie would make
    register.aspx pop up at all times and it would be annoying for the
    user. I want it to be authenticated, but always force authentication
    to pass by register.aspx.

    Some people will say, what's the point if you can track info directly
    in the destination or protected file. Well in this case I know I can
    track this type of info in openvideo.aspx since it gets hit all the
    times, but it does not protect the media files from direct browser
    access. If you know the path to the media you can access it easily.

    Right now that is not my major concern. Later, I'll need to use a
    handler to handle the media by file extension (ex. wmv, mpeg, etc)
    without intermediate pages. And if you want to track something at all
    events it will have to pass by register.aspx.

    Maybe I confused you more, sorry about that and thanks for you
    patience.

    Rodrigo
    rodrigo 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