ACS installed but MVC 4.0 app still redirects and fails to find login.aspx ACS installed but MVC 4.0 app still redirects and fails to find login.aspx azure azure

ACS installed but MVC 4.0 app still redirects and fails to find login.aspx


Open your web.config file.

Locate the Authentication node.

Change it from:

<authentication mode="Forms" />

To:

<authentication mode="None" />

Comment here, if it doesn't help, and what is the result after changes to web.config.

As a side question - how did you add reference to the ACS namespace - via "right click -> Add STS Reference", or manually changed the web.config ?

Make sure that the required Modules are registered with the web server:

  <system.webServer>    <modules runAllManagedModulesForAllRequests="true">      <add name="ClaimsPrincipalHttpModule" type="Microsoft.IdentityModel.Web.ClaimsPrincipalHttpModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />      <add name="WSFederationAuthenticationModule" type="Microsoft.IdentityModel.Web.WSFederationAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />      <add name="SessionAuthenticationModule" type="Microsoft.IdentityModel.Web.SessionAuthenticationModule, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler" />    </modules>   ... </system.webServer>

Also make sure that you have microsoft.identityModel section, and you have federatedAuthentcation node within it:

<federatedAuthentication>        <wsFederation passiveRedirectEnabled="true" issuer="https://[your_namespace].accesscontrol.windows.net/v2/wsfederation"                       realm="http://127.0.0.1:81/" requireHttps="false" />        <cookieHandler requireSsl="false" /></federatedAuthentication>

Where "realm" shall be valid URL for Realying Party Application. And requireHttps="false" is to simplify development process.

When you debug it locally, make sure you are running the Cloud project (which uses IIS), and not the Web Project (which will use Cassini / webdevserver, which does not understand the system.webServer section!)