Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow config in <appSettings> #2

Closed
grimurd opened this issue Sep 14, 2014 · 4 comments
Closed

Allow config in <appSettings> #2

grimurd opened this issue Sep 14, 2014 · 4 comments

Comments

@grimurd
Copy link

grimurd commented Sep 14, 2014

It would be really useful if the module had the ability to be configured or just disabled through the appSettings section in web.config.

This would allow me for example when using azure to disable this module through my azure website configuration instead of changing the web.config manually and pushing a new build.

Would also be really comfortable for when i switch my staging server with the production server on azure. I could use this module on the staging server but the production server config disables it automatically when it get switched.

Any change of seeing this get implemented?

Update: I also just noticed that this module puts an authorization header on all requests. This pretty much makes it unusable for me since i'm using web api with an angular client which overwrites the authorization header. Any chance that the module could use an alternative header or at least provide the possibility to do so?

@nabehiro
Copy link
Owner

Hi, Sk1Zy.

If you want to disable HttpAuthModule, you remove following element in web.config.

<system.webServer>
  <modules>
    <!-- remove this ! -->
    <add type="HttpAuthModule.HttpAuthModule" name="HttpAuthModule"/>
  </modules>

No indicating HttpAuthModule in modules section, HttpAuthModule don't run.

I switch web.config configuration by deployment envoronment,
I use web.config transformation, it's very useful.
http://msdn.microsoft.com/en-us/library/dd465326(v=vs.110).aspx

I'm not sure angular client behavior.
And I think specified requests can't put authorization header on a site.

If you wish specified url pattern (e.g. web api url) skips authentication,
"IgnorePathRegex" setting might be a help.

thanks.

@grimurd
Copy link
Author

grimurd commented Sep 16, 2014

I can't disable the module this way through my azure website management portal. The azure management portal only allows you to change settings in the appSettings section.
I don't think transforms would help me in my case since i use the release version on both my staging site and my production site. Thats why it would be useful to have the ability to disable it through the appSetting section.

I'll try the IgnorePathRegex setting, thanks for that.

@nabehiro
Copy link
Owner

I understood why disabling by appSetting be required.
I added appSetting configuration that disables or enables HttpAuthModule on v2.1.2

https://github.com/nabehiro/HttpAuthModule#disable-httpauthmodule-by-appsettings
please try.

thanks good feedback !

@nabehiro nabehiro closed this as completed Oct 1, 2014
@grimurd
Copy link
Author

grimurd commented Oct 1, 2014

I forgot to report back, but this works great. Thanks for the fast response 👍

nabehiro pushed a commit that referenced this issue Oct 25, 2021
nabehiro added a commit that referenced this issue Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants