Basic Authentication on IIS Express

后端 未结 3 1243
一个人的身影
一个人的身影 2021-02-07 04:01

I\'ve searched for a while now but I can\'t seem to find the answer. There are ways of disabling/enabling anonymous and windows authentication. Does anyone know how to enable ba

相关标签:
3条回答
  • 2021-02-07 04:14

    Here are slightly more details than the previous answer had:

    1. %USERPROFILE%\Documents\IISExpress\config\applicationhost.config: <basicAuthentication enabled="true" />

    2. In the same file: set <anonymousAuthentication enabled="false" userName="" />

    3. If you are not using domain test accounts, create a local user account with the password for the test login.

    0 讨论(0)
  • 2021-02-07 04:21

    Update ApplicationHost.config

    In the the ApplicationHost.config file, find the following nodes and update the values:

    <sectionGroup name="authentication">
       <basicAuthentication enabled="false" /> <!-- set to false -->
    </sectionGroup>
    
    <!-- ... -->
    
    <authentication>
       <section name="basicAuthentication" overrideModeDefault="Allow" /> <!-- set to allow -->
    </authentication>
    

    Locate ApplicationHost.config

    • VS 2015 and above (per Joost's answer):

      sln_folder/.vs/applicationhost.config
      
    • VS 2013 and below:

      %UserProfile%\Documents\IISExpress\config\applicationhost.config
      

      As far as I know, there is no way to enable it for only one project.

    0 讨论(0)
  • 2021-02-07 04:29

    An additional heads up, in Visual Studio 2015, the location of the applicationhost.config file that is actually being used is inside a folder called .vs inside your solution folder. The one in your user profile is not being used

    0 讨论(0)
提交回复
热议问题