Base solution for your next web application
Open Closed

Do not use IIS authentication methods #12217


User avatar
0
[email protected] created

Version of ASP.NET Zero in use: - Project type: ASP.NET CORE MVC & jQuery - Project version: 12.3.1 - .NET version: .NET 6 - Web Server: IIS

My question: - Case 1: How to disable all Authentication in IIS including (Anonymous, Basic, Windows) but the web site still works when deployed on IIS? I tried to disable but it reported an error HTTP Error 401.2 - Unauthorized - Case 2: When it is required to enable an authentication method in IIS, in case Baisc authentication is enabled, how to bypass the popup when accessing the website by hard-passing a username and password


1 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi BaoNT3

    To disable all authentication in IIS and keep your site running, just go to your site settings in IIS, find the Authentication section, and turn off Anonymous, Basic, and Windows Authentication. Then, in your appsettings.json, disable authentication as needed and add [AllowAnonymous] to any controllers that should be accessible.

    If Basic Authentication is on and you want to skip the login popup, you can put your username and password right in the URL like this: http://username:[email protected]. Another option is to set up some middleware or a proxy to manage authentication without the popup.