Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/14.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.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
Asp.net mvc 验证表单时出现MVC4 Windows Azure ACS 500内部服务器错误_Asp.net Mvc_Windows_Forms_Azure_Acs - Fatal编程技术网

Asp.net mvc 验证表单时出现MVC4 Windows Azure ACS 500内部服务器错误

Asp.net mvc 验证表单时出现MVC4 Windows Azure ACS 500内部服务器错误,asp.net-mvc,windows,forms,azure,acs,Asp.net Mvc,Windows,Forms,Azure,Acs,我遵循本教程:http://robbincremers.me/2012/02/22/using-windows-azure-access-control-service-to-provide-a-single-sign-on-experience-with-popular-identity-providers/#comment-469 使用本指南或其他指南,当在web配置中取消对身份验证表单的注释以使用从windows azure访问控制门户下载的自定义html登录表单时,我得到一个500内部服

我遵循本教程:http://robbincremers.me/2012/02/22/using-windows-azure-access-control-service-to-provide-a-single-sign-on-experience-with-popular-identity-providers/#comment-469

使用本指南或其他指南,当在web配置中取消对身份验证表单的注释以使用从windows azure访问控制门户下载的自定义html登录表单时,我得到一个500内部服务器错误。有什么不对劲吗

它只是添加了身份验证表单

<location path="FederationMetadata">
    <system.web>
      <customErrors mode="Off"/>
      <authorization>
        <allow users="*" />
      </authorization>
    </system.web>
  </location>
  <system.web>
    <httpRuntime requestValidationMode="2.0"/>
   <!-- <authorization>
      <deny users="?" />
    </authorization>-->
    <authentication mode="None" />
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <!--Commented out by FedUtil-->
    <authentication mode="Forms"><forms loginUrl="~/Federation/Login.html" timeout="2880" /></authentication>
    <pages>
      <namespaces>
        <add namespace="System.Web.Helpers" />
        <add namespace="System.Web.Mvc" />
        <add namespace="System.Web.Mvc.Ajax" />
        <add namespace="System.Web.Mvc.Html" />
        <add namespace="System.Web.Optimization" />
        <add namespace="System.Web.Routing" />
        <add namespace="System.Web.WebPages" />
      </namespaces>
    </pages>
    <httpModules>
      <add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </httpModules>
  </system.web>

这是因为身份验证元素定义了两次。web.config中只能存在一个。在第14行,您有:

<authentication mode="None" />
<authentication mode="Forms"><forms loginUrl="~/Federation/Login.html" timeout="2880" /></authentication>

在第21行,您有以下内容:

<authentication mode="None" />
<authentication mode="Forms"><forms loginUrl="~/Federation/Login.html" timeout="2880" /></authentication>


删除或注释其中的一行来修复这个问题。

你的Syr.IdItMyType PAR是Web.CONFIG的哪一个?此外,您可能希望签出(本文)[其中有一个可供下载的工作代码示例。您所需要的只是使用您的ACS命名空间配置其中的ACS相关信息。您应该接受对您有帮助的答案