Forms authentication doesn't work for downloads

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

  1. #1

    Default Forms authentication doesn't work for downloads

    Hello,

    I'm using Forms authentication, and it works well. If user is not
    authenticated, he is routed to the login page.

    However, this doesn't work for downloads. If I have a file located in the
    restricted area and put a direct link to it - anyone can download it.

    Why is this? I expected that people would also be routed to the login
    screen. How to make this happen?

    I would appreciate your help.

    Thank you,

    --
    Peter Afonin


    Peter Afonin Guest

  2. Similar Questions and Discussions

    1. ASP.NET Forms Authentication don't work on some Window XP
      (Type your message here) I am working on ASP.NET project where I am using formauthentication, it seems to work fine on all OS including XPexcept on...
    2. forms authentication doesn't work for static pages/files like GIF/HTML/PDF ?
      do I understand it correctly that forms authentication doesn't work for static pages/files like GIF/HTML/PDF ? so I cannot convince IIS to...
    3. Forms Authentication does not work when using computer name
      Greetings, My asp.net app is using Forms Authentication. Running the project from the Visual Studio .NET 2003 has absolutely no problem. I use...
    4. Forms Authentication timeout doesn't work
      I am trying to do some testing of my application with respect to timeouts (i.e. Session timeouts). I took the advice of somebody else in this...
    5. Unable to get Forms-based Authentication to work
      Hello, I'm new to ASP.NET, and I'm trying to learn how to implement forms based authentication. However, I don't know what I'm doing wrong....
  3. #2

    Default Re: Forms authentication doesn't work for downloads

    Forms authentication is handled by the framework - thus you likely need to
    pass that type of file through the asp.net handler by mapping it in IIS...

    --
    Regards

    John Timney
    ASP.NET MVP
    Microsoft Regional Director

    "Peter Afonin" <pva@speakeasy.net> wrote in message
    news:%23iyeHzZ0EHA.2316@TK2MSFTNGP15.phx.gbl...
    > Hello,
    >
    > I'm using Forms authentication, and it works well. If user is not
    > authenticated, he is routed to the login page.
    >
    > However, this doesn't work for downloads. If I have a file located in the
    > restricted area and put a direct link to it - anyone can download it.
    >
    > Why is this? I expected that people would also be routed to the login
    > screen. How to make this happen?
    >
    > I would appreciate your help.
    >
    > Thank you,
    >
    > --
    > Peter Afonin
    >
    >

    John Timney \(ASP.NET MVP\) Guest

  4. #3

    Default Re: Forms authentication doesn't work for downloads

    Forms Auth works only for those pages/file/resources which are processed by
    ASP.NET by default. That is aspx,asmx, config and such. You can tweak that
    in IIS (See Applications configuration for different file extensions like
    where aspx is mapped to aspnet_isapi.dll) by having the custom file
    extension mapped for aspnet_isapi.dll

    See this blog post for detailed explanations:

    Protect PDF, DOC and other file types with Forms Authentication
    [url]http://dotnetjunkies.com/WebLog/richard.dudley/archive/2004/05/21/14215.aspx[/url]

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsider
    ASP.NET Forum Moderator, AspAlliance Columnist
    [url]http://blogs.aspadvice.com/joteke[/url]



    "Peter Afonin" <pva@speakeasy.net> wrote in message
    news:%23iyeHzZ0EHA.2316@TK2MSFTNGP15.phx.gbl...
    > Hello,
    >
    > I'm using Forms authentication, and it works well. If user is not
    > authenticated, he is routed to the login page.Protect PDF, DOC and other
    file types with Forms Authentication
    >
    > However, this doesn't work for downloads. If I have a file located in the
    > restricted area and put a direct link to it - anyone can download it.
    >
    > Why is this? I expected that people would also be routed to the login
    > screen. How to make this happen?
    >
    > I would appreciate your help.
    >
    > Thank you,
    >
    > --
    > Peter Afonin
    >
    >

    Teemu Keiski Guest

  5. #4

    Default Re: Forms authentication doesn't work for downloads

    Thank you very much for your explanations!

    Peter

    "Teemu Keiski" <joteke@aspalliance.com> wrote in message
    news:%23l2qg3Z0EHA.1940@TK2MSFTNGP15.phx.gbl...
    > Forms Auth works only for those pages/file/resources which are processed
    by
    > ASP.NET by default. That is aspx,asmx, config and such. You can tweak that
    > in IIS (See Applications configuration for different file extensions like
    > where aspx is mapped to aspnet_isapi.dll) by having the custom file
    > extension mapped for aspnet_isapi.dll
    >
    > See this blog post for detailed explanations:
    >
    > Protect PDF, DOC and other file types with Forms Authentication
    >
    [url]http://dotnetjunkies.com/WebLog/richard.dudley/archive/2004/05/21/14215.aspx[/url]
    >
    > --
    > Teemu Keiski
    > MCP, Microsoft MVP (ASP.NET), AspInsider
    > ASP.NET Forum Moderator, AspAlliance Columnist
    > [url]http://blogs.aspadvice.com/joteke[/url]
    >
    >
    >
    > "Peter Afonin" <pva@speakeasy.net> wrote in message
    > news:%23iyeHzZ0EHA.2316@TK2MSFTNGP15.phx.gbl...
    > > Hello,
    > >
    > > I'm using Forms authentication, and it works well. If user is not
    > > authenticated, he is routed to the login page.Protect PDF, DOC and other
    > file types with Forms Authentication
    > >
    > > However, this doesn't work for downloads. If I have a file located in
    the
    > > restricted area and put a direct link to it - anyone can download it.
    > >
    > > Why is this? I expected that people would also be routed to the login
    > > screen. How to make this happen?
    > >
    > > I would appreciate your help.
    > >
    > > Thank you,
    > >
    > > --
    > > Peter Afonin
    > >
    > >
    >
    >

    Peter Afonin 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