web.config single user basic auth

核能气质少年 提交于 2020-01-14 10:23:19

问题


In nginx I can create a authentication response which sends

WWW-Authenticate:Basic realm="Private Network"

causing a login for a single user/password to popup without creating a login.aspx

Here's my config settings

<security>
  <authentication  >
    <anonymousAuthentication enabled="true" userName="test" password="test" />
    <!--<basicAuthentication enabled="true" logonMethod="Batch" />-->
    <!--<windowsAuthentication enabled="true" />-->
  </authentication>
</security>

<authentication mode="Forms">
  <forms>
    <credentials passwordFormat="Clear">
      <user name="test" password="test" />
    </credentials>
  </forms>

</authentication>

<location path="." >
    <system.web>
      <authorization>
        <allow roles="admin" />
        <deny users="*"/>
      </authorization>
    </system.web>
</location>

However these settings keep taking me to login.aspx which is unwritten.

My goal is to create a simple u/p auth for one user without resorting to login pages or more complex auth.

来源:https://stackoverflow.com/questions/17660853/web-config-single-user-basic-auth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!