IIS Restrict Access to Directory for table of users

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2012-11-13T16:28:14Z Indexed on 2012/11/13 17:01 UTC
Read the original article Hit count: 292

I am trying to restrict access to files in a directory and it's sub directories based user rights. My user rights are stored in an MS SQL database in a custom format, however it is easy to query the list of users with rights to this directory.

I need to know how to apply this to a web config on the server to authenticate against a query of a database table to determine if the username is authenticated and allowed to view the file. Of course if they are not they should be blocked / given a 404.

I am using IIS and ASP.Net MVC3 with a form based security as opposed to the built in roles and responsibilities that was custom made for us and that works great. There are over 10k users tied to this non-Active Directory authentication so I am not planning to change my authentication type so please don't go there.

It is not my decision on the choice of platform, or I would have gone with a LAMP server and been done with this.

Edit 11-13-2012 @ 8:57a: In the web config can you put the result of an SQL query?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about iis