Web.config one user base auth

In nginx, I can create an authentication response that sends

WWW-Authenticate: Basic realm = "Private Network"

calling the login for a single user / password for a popup without creating login.aspx

Here are 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 continue to lead me to login.aspx, which is not written.

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

+3
source share

Source: https://habr.com/ru/post/1617849/


All Articles