问题
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