Web.config ignores certain files that require authentication

In my asp.net web application I have a folder where I have some html and jpeg files. some of these files don't need a user to login, while others. How can I exclude files that might be viewable without logging in while keeping the user logged in to view other files in the same folder using only the config file. I haven't been able to find something relevant in the config file, or maybe I didn't notice it. If anyone knows please answer.

Thanks.

0


a source to share


1 answer


I tried to answer this as best I can, but the suggestion is:

How can I exclude files that are free to view from being displayed without logging in while keeping the user logged in to view other files in the same folder using just the config file.

..a bit confusing!



The files to be authenticated are the ones that are processed by an asp.net handler such as .aspx files. jpegs and other static files bypass this can be viewed without authentication. The aspnet_isapi handler only processes certain files, but you can customize it to handle more file extensions (or all files) by configuring extension mappings in IIS.

Personally, I would put all the files I would like to protect in a folder with permissions to allow anyone to view that folder, set the aspnet_isapi handler to handle all files, and then protect your other folders according to your applications.

Depending on what you want to do (since your question is not so clear), you may or may not be able to achieve what you want from just a config file, but hopefully this answer provides you with the information you need to draw your own conclusions from this.

+1


a source







All Articles