Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Sustainsys.Saml2 HttpModule Configuration Programmatically

I have a legacy Web Forms ASP.Net project where I just successfully integrated Sustainsys.Saml2.

I was wondering how can Make configuration changes programmatically.

For example: in the webconfig, I define my (the SP) metadata url. However, because I run on my Dev machine, plus a test server, a QA server and then production server, each have their own Urls. I want to be able to programmatically change the Url based on the site that is running.

Thank you.

like image 445
RoLYroLLs Avatar asked Oct 15 '25 04:10

RoLYroLLs


1 Answers

Yes, it's possible. You can access the Options.FromConfiguration static property and modify it from code. In fact, many of the recent added features are not available in web.config.

The Options.FromConfiguration will read settings from web.config on first access, but then the copy in memory is free to modify.

like image 198
Anders Abel Avatar answered Oct 17 '25 21:10

Anders Abel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!