Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iis 7 从远程服务器对站点进行的基本身份验证不起作用_Iis 7_Forms Authentication_Asp.net 4.0_Basic Authentication - Fatal编程技术网

Iis 7 从远程服务器对站点进行的基本身份验证不起作用

Iis 7 从远程服务器对站点进行的基本身份验证不起作用,iis-7,forms-authentication,asp.net-4.0,basic-authentication,Iis 7,Forms Authentication,Asp.net 4.0,Basic Authentication,我使用SHA1 pw和存储在web.config中的凭据设置了一个真正基本的身份验证模式 部署.Net 4.0站点(在IIS 7中)后,当我从该站点所在的服务器转到www位置时,我可以成功登录 但是,当尝试从另一台计算机上的浏览器登录时,输入相应的凭据只会循环返回登录屏幕 在站点的IIS身份验证中,我启用了匿名、基本和表单 <system.web> <compilation debug="true" targetFramework="4.0"> <

我使用SHA1 pw和存储在web.config中的凭据设置了一个真正基本的身份验证模式

部署.Net 4.0站点(在IIS 7中)后,当我从该站点所在的服务器转到www位置时,我可以成功登录

但是,当尝试从另一台计算机上的浏览器登录时,输入相应的凭据只会循环返回登录屏幕

在站点的IIS身份验证中,我启用了匿名、基本和表单

  <system.web>
    <compilation debug="true" targetFramework="4.0">
    </compilation>
    <authentication mode="Forms">
      <!-- <forms loginUrl="~/Account/Login.aspx" timeout="2880"/> -->
      <forms name=".ASPXFORMSAUTH" loginUrl="~/Account/Login.aspx" defaultUrl="~/AdminPages/Default.aspx" cookieless="UseCookies"  timeout="30">
        <credentials passwordFormat="SHA1">
          <user name="user1" password="77A80B8DE9F00DD1CC502344C38FC1BA24CC0897" />
          <user name="user2" password="329E66AD5EC6E09AA8002311ACAF6ADBACD12DC4" />
        </credentials>
      </forms>
    </authentication>
    <authorization>
      <deny users="?" />
    </authorization>
  </system.web>
  <location path="Styles">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="Scripts">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="Account">
    <system.web>
      <authorization>
        <allow users="*"/>
      </authorization>
    </system.web>
  </location>
  <location path="AdminPages">
    <system.web>
      <authorization>
        <allow users="user1,user2"/>
        <deny users="*"/>
      </authorization>
    </system.web>
  </location>

有什么想法吗


谢谢。

使用以下配置,我能够使用存储在Web.config中的凭据,通过SHA1 pw加密实现所需的基于用户的身份验证。希望它能帮助某人:

<authentication mode="Forms">
  <forms defaultUrl="~/AdminPages/Website.aspx" loginUrl="~/Account/Login.aspx" slidingExpiration="true" timeout="1000">
    <credentials passwordFormat="SHA1">
      <user name="baden1" password="77A80B8DE9F00DD1CC502344C38FC1BA24CC0897"/>
      <user name="bruno1" password="329E66AD5EC6E09AA8002311ACAF6ADBACD12DC4"/>
    </credentials>
  </forms>
</authentication>
<authorization>
  <allow users="admin"/>
  <deny users="?"/>
</authorization>