Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

protecting non .aspx pages with Asp.net Membership provider

I'm currently using the asp.net membership provider (with logins stored in db) to protect certain pages of my site. However, I also have non .aspx resources I wish to protect - word docs, excel spreadsheets, pdfs, etc. Is this even possible? If so how would I go about doing this?

thanks!

like image 704
Dave Avatar asked Apr 21 '10 20:04

Dave


2 Answers

The procedure is described here. And here. And here.

Sorry I'm just giving links and no code examples or description. It's too long an answer to post fully here.

like image 185
David Avatar answered Oct 17 '22 23:10

David


If you are running IIS 7 under the integrated pipeline (the default setup), all requests go through IIS. This means you have to do nothing other than setup your web.config. You'll need to do one little thing though, put the following attribute on the modules node under system.webServer:

<modules runAllManagedModulesForAllRequests="true" />

This ensures that the forms authentication modules run for your static content.

like image 25
Keltex Avatar answered Oct 17 '22 23:10

Keltex