title: MVC client can't authenticate on IIS
body: <p>I've succeeded with IdentityServer3 implementation. I created ASP.NET MVC5 client with implicit flow and this Owin startup configuration:</p>
  
  <pre class="lang-cs prettyprint-override"><code>app.UseCookieAuthentication(new CookieAuthenticationOptions
      { AuthenticationType = "Cookies" });
  
  app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
      {
         ClientId = "mvc.client",
         Authority = Constants.ServerUri,
         RedirectUri = Constants.MvcClientUri,
         ResponseType = "id_token",
         Scope = "openid profile",
         UseTokenLifetime = false,
         SignInAsAuthenticationType = "Cookies",
  
         Notifications = new OpenIdConnectAuthenticationNotifications
           { SecurityTokenValidated = TokenValidatedNotification },
          });
  </code></pre>
  
  <p>Everything works perfect running locally on IIS Express, but fails when deployed to production IIS server. Authentication is successful in both cases - <code>id_token</code> is returned from then same IdentityServer, but on production user is never authenticated, notification is not fired. Project references <code>Microsoft.Owin.Host.SystemWeb</code> assembly. I've registered exception handling <code>OwinMiddleware</code> as first one, but no unhandled exception was catched.</p>