title: owin external login not redirecting to client application
body: <p>I have a dedicated web api identity server used by potentially multiple client applications. Now I am trying to get the flow for Facebook authentication work. The process is very similar to the one found in microsoft examples. Here's an image of the flow:</p>
  
  <p><img src="https://i.stack.imgur.com/hFSgE.png" alt="enter image description here"></p>
  
  <p>Basically my problem is that once last call is finished successfully, browser is not redirected to client application (localhost:9053).</p>
  
  <p>ExternalLogin in API:</p>
  
  <pre><code>[OverrideAuthentication]
  [HostAuthentication(DefaultAuthenticationTypes.ExternalCookie)]
  [AllowAnonymous]
  [Route("api/externalLogin", Name = "externallogin")]
  public async Task&lt;IHttpActionResult&gt; GetExternalLogin(string provider)
  {
      if (User == null || !User.Identity.IsAuthenticated)
      {
          return new ChallengeResult(provider, this);
      }
  
      ExternalLoginData externalLogin = FromIdentity(provider, User.Identity as ClaimsIdentity);
  
      if (externalLogin == null)
      {
          return InternalServerError();
      }
  
      if (externalLogin.LoginProvider != provider)
      {
          Authentication.SignOut(DefaultAuthenticationTypes.ExternalCookie);
          return new ChallengeResult(provider, this);
      }
  
      IdentityUser user = await UserManager.FindByIdAsync(externalLogin.UserName);
  
      Authentication.SignOut(DefaultAuthenticationTypes.ExternalCookie);
      ClaimsIdentity oAuthIdentity = await _userManager.CreateIdentityAsync(user, OAuthDefaults.AuthenticationType);
      ClaimsIdentity cookieIdentity = await _userManager.CreateIdentityAsync(user, CookieAuthenticationDefaults.AuthenticationType);
  
      IDictionary&lt;string, string&gt; data = new Dictionary&lt;string, string&gt;
      {
          { "userName", user.UserName }
      };
  
      var properties = new AuthenticationProperties(data);
      Authentication.SignIn(properties, oAuthIdentity, cookieIdentity);
  
      return Ok();
  }
  </code></pre>
  
  <p>Given a user who is signed into their facebook account and have already accepted permission for this application, it performs the tasks in the image, which ends up coming all the way to the bottom of this method and returning Ok() (200). After this step, I expected owin facebook middleware to intercept and redirect the user to the client user localhost:9053 but that is not happening and it just hangs there.</p>
  
  <p>Any ideas anyone?</p>