Reputation: 275
I´m following this tutorial: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
Using this guide or others, when uncomment the authentication forms in the web config for using the custom html login form downloaded from windows azure access control portal, I get an 500 Internal Server Error. What could be wrong?
It is just adding authentication form
<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>
Upvotes: 1
Views: 1203
Reputation: 24895
That's because the authentication element is defined twice. Only one can exist in the web.config. On line 14 you have this:
<authentication mode="None" />
On line 21 you have this:
<authentication mode="Forms"><forms loginUrl="~/Federation/Login.html" timeout="2880" /></authentication>
Remove or comment out one of these lines to fix the issue.
Upvotes: 3