Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Authentication and XML

Status
Not open for further replies.

JimmyFo

Programmer
Feb 14, 2005
102
US
Hi, I am using Windows authentication on an intranet application - the web.config looks something like this:

Code:
		<authentication mode="Windows">
		</authentication>
		<authorization>
			<allow users="domain\user, BUILTIN\Administrator, BUILTIN\Administrators"/>
			<deny users="*"/>
		</authorization>

What I would like to do is have the "allow users" be dynamic - in other words, have the list of users be read from an XML file, from a database, or something like that. Is there a way to do this? Can I programmatically change the web.config at run time?

Thanks!
James
 
You can edit config file at run time. Be aware, your app will reset and sessions will be gone
 
Thanks, I'll give that a shot and see how it goes - it's just a quick fix for a longer term problem.

I can't set the allowed roles from an XMLfile? bummer...

Thanks though!
 
You can leave the Authorization part of the web config to it's default, and do your authorization in code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top