Both cases use HSTS regardless if code is running in development mode or not; while documentation clearly says:
UseHsts isn't recommended in development because the HSTS settings are highly cacheable by browsers. By default, UseHsts excludes the local loopback address.
Unfortunately there is one more issue. Documentation says:
UseHsts excludes the following loopback hosts:
localhost : The IPv4 loopback address.
127.0.0.1 : The IPv4 loopback address.
[::1] : The IPv6 loopback address.
But this UseHsts is from NWebsec.AspNetCore.Middleware and does not follow rules above!
Hi @skoruba ,
there is a problem with HSTS implementation both in STS and Admin project https://github.com/skoruba/IdentityServer4.Admin/blob/7ec3b94cef55ffa5e6b677e2be8ab68287d21439/src/Skoruba.IdentityServer4.STS.Identity/Helpers/StartupHelpers.cs#L99
Both cases use HSTS regardless if code is running in development mode or not; while documentation clearly says:
Unfortunately there is one more issue. Documentation says:
But this UseHsts is from NWebsec.AspNetCore.Middleware and does not follow rules above!
Anyway, I propose we move app.UseHsts back to Startup.cs in else statement and use Microsoft provided implementation. https://github.com/skoruba/IdentityServer4.Admin/blob/be6fc55a61d890378dd21f9110c2850e963a487f/src/Skoruba.IdentityServer4.STS.Identity/Startup.cs#L55-L58
Any thoughts?
Thank you