« Previous Next »

Thread: Make IIS7 run custom authorization code before allowing download

Last post 04-30-2009 1:10 PM by anilr. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 04-30-2009, 8:47 AM

    • brunopiovan
    • Not Ranked
    • Joined on 08-02-2003, 12:35 AM
    • São Paulo, Brazil
    • Posts 1

    Make IIS7 run custom authorization code before allowing download

    Hello,

    I'm working on a asp.net system that has a custom download page, this page checks if the user is authorized to download the requested file, and if yes, it opens the file and starts sending chunks to the client.

    It was running on IIS6 and the server was updated to Windows 2008/IIS7 and I don't think this custom download page is needed anymore, what I would like to do is create a custom module that when a request is made to File.zip, IIS7 will run this custom module that will check if the user is allowed to download or not, and if yes, the download will start and the process will be handled by the IIS7 process itself instead of the asp.net process.

    Is it possible?

  • 04-30-2009, 1:10 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: Make IIS7 run custom authorization code before allowing download

    First of all, I am not sure what you mean by "IIS process" vs "asp.net process" - there is only one process w3wp.exe (unless you are talking about IIS5 isolation mode on IIS6).  If you are talking about IIS pipeline vs asp.net pipeline - IIS7 now also has a single integrated pipeline, so you can write a module which sits on AuthorizeRequest, makes the authorization decision, rejects the request if needed or allows it to be handled by whatever handler would handle the request.

    There is no need to have the authorization module be responsible for the actual download/rendering - and it wasn't needed in IIS6 either.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
Page 1 of 1 (2 items)
Microsoft Communities