[英]MVC4 Windows Azure ACS 500 Internal Server Error when Authentication Forms
我遵循這個教程:http://robbincremers.me/2012/02/22/using-windows-azure-access-control-service-to-provide-a-single-sign-on-experience-with-popular -identity - 供應商/#評論-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" />
在第21行你有這個:
<authentication mode="Forms"><forms loginUrl="~/Federation/Login.html" timeout="2880" /></authentication>
刪除或注釋掉其中一行以解決問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.