Monday, March 26, 2012

Windows authentication

Hello,

I have an intranet where I obtain the windows login information from when a user goes to a page in my website via windows authenication. However there are certain users I need to allow and dis-allow access to my site. I know that you can hard code this in the web.config file. How do I dynamically update my allow and dis allow list in my web.config file This list in in a sql database.

Thanks

Grant

with 2.0 you can read AND write to the web.config (1.1 it was read only). Just remember that when you change the web.config your app recycles...

Thanks that is good to know.

However this will not suite my situation. Is there no way to somehow base windows authentication on a database full of logins. Currently I do this manually on everypage which is not really good. Eg When "domain\user1" logs on I check my SQL table to see if "domain\user1" exists if so I let him view page.(This is done on page_load on every page in application) Is there no way have having this somehow setup once so that everypage in my application does this automatically. Or once then a state is saved something like forms authenication but with windows authentication

Many thanks

Grant


Oh... I see now.

If you turn off Anonymous and turn on Integrated. Then set the web.config to use Windows Authentication you should be set.

0 comments:

Post a Comment