Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > When are the FormsAuthentication class' configuration settings read?

Reply
Thread Tools

When are the FormsAuthentication class' configuration settings read?

 
 
matt
Guest
Posts: n/a
 
      09-25-2006
Hi,

I'm writing a HttpModule which is going to require certain settings in
the FormsAuthentication configuration (for example, I need to ensure
enableCrossAppRedirects = true).

Now my best effort so far has been to run through the configuration
settings I require and raise exceptions if the web.config hasn't been
set up correctly. Ideally though, I'd like the sites this module will
go into not to have to paste boilerplate settings into web.config, and
instead just fix the settings from within my HttpModule's code at
Init().

Is this possible?

Obviously just changing the FormsAuthentication class' properties
doesn't work as they're read only (though I guess using a reflection
hack might be an option..?).

I've tried opening the config file using WebConfigurationManager,
changing settings and doing Save(), but these new values don't seem to
be reflected on the FormsAuthentication class' properties

Can anyone with some inside / in-depth knowledge of the
FormsAuthentication class give me some clues as to how this hangs
together?

thanks,
Matt

 
Reply With Quote
 
 
 
 
Dominick Baier
Guest
Posts: n/a
 
      09-25-2006
Hi,

when you Save the changed config file - the appdomain will recycle and has
the changed settings on the next restart.

But you will need a) write access to web.config and b) the add files ACL
for the web root for the worker process account - nothing i would recommend
from a security perspective.

---
Dominick Baier, DevelopMentor
http://www.leastprivilege.com

> Hi,
>
> I'm writing a HttpModule which is going to require certain settings in
> the FormsAuthentication configuration (for example, I need to ensure
> enableCrossAppRedirects = true).
>
> Now my best effort so far has been to run through the configuration
> settings I require and raise exceptions if the web.config hasn't been
> set up correctly. Ideally though, I'd like the sites this module will
> go into not to have to paste boilerplate settings into web.config, and
> instead just fix the settings from within my HttpModule's code at
> Init().
>
> Is this possible?
>
> Obviously just changing the FormsAuthentication class' properties
> doesn't work as they're read only (though I guess using a reflection
> hack might be an option..?).
>
> I've tried opening the config file using WebConfigurationManager,
> changing settings and doing Save(), but these new values don't seem to
> be reflected on the FormsAuthentication class' properties
>
> Can anyone with some inside / in-depth knowledge of the
> FormsAuthentication class give me some clues as to how this hangs
> together?
>
> thanks,
> Mat



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Settings.settings file with settings for multiple regions donet programmer ASP .Net 3 11-20-2009 03:05 PM
Can't access C\Documents and Settings\Owner\Local Settings? ECLiPSE 2002 Computer Support 2 09-23-2008 01:32 PM
moving "my documents and settings\user\local settings\temp" FredHead Computer Support 11 01-17-2007 06:03 AM
When are the FormsAuthentication class' configuration settings read? matt ASP .Net 1 09-25-2006 10:55 AM
Wanted: Help with Document settings\ServerName\ASPNET\Local settings\Temp Siegfried Heintze ASP .Net 0 10-24-2005 06:02 PM



Advertisments