How to set up a web forms application with id and owin to refuse all pages except login?
This configuration in web.config does not work for me:
<system.web> <authorization> <deny users="*"/> </authorization> <authentication mode="None"/>
Error message: The query filtering module is configured to refuse a request where the query string is too long.
OWIN Launch Class:
public void ConfigureAuth(IAppBuilder app) { // Configure the db context, user manager and signin manager to use a single instance per request app.CreatePerOwinContext(ApplicationDbContext.Create); app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create); app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create); // Enable the application to use a cookie to store information for the signed in user // and to use a cookie to temporarily store information about a user logging in with a third party login provider // Configure the sign in cookie app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Login"), Provider = new CookieAuthenticationProvider { OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, Usuario>( validateInterval: TimeSpan.FromMinutes(0), regenerateIdentity: (manager, user) => manager.GenerateUserIdentityAsync(user)) } });
Project structure 
Edit:
In the web.config folder inside the account there is such a configuration.
<configuration> <location path="Manage.aspx"> <system.web> <authorization> <allow users="?"/> </authorization> </system.web> </location> </configuration>
This works for the Manage.aspx page.
I do not want to do this for every page. I want to add a global web.config site.
source share