title: Unknow parameter returnUrl identity
body: <p>I am facing a problem using identity to authenticate the user in a project I am working on.
  I have no idea why, but after leaving <code>public void Configuration(IAppBuilder app)</code> a parameter returnUrl is added to my uri and makes it crash because the uri is too long.</p>
  
  <p>Here is the uri returned</p>
  
  <pre><code>http://localhost:51092/Login/Index?ReturnUrl=%2FLogin%2FIndex%3FReturnUrl%3D%252FLogin%252FIndex%253FReturnUrl%253D%25252FLogin%25252FIndex%25253FReturnUrl%25253D%2525252FLogin%2525252FIndex%2525253FReturnUrl%2525253D%252525252FLogin%252525252FIndex%252525253FReturnUrl%252525253D%25252525252FLogin%25252525252FIndex%25252525253FReturnUrl%25252525253D%2525252525252FLogin%2525252525252FIndex%2525252525253FReturnUrl%2525252525253D%252525252525252FLogin%252525252525252FIndex%252525252525253FReturnUrl%252525252525253D%25252525252525252FLogin%25252525252525252FIndex%25252525252525253FReturnUrl%25252525252525253D%2525252525252525252FLogin%2525252525252525252FIndex%2525252525252525253FReturnUrl%2525252525252525253D%252525252525252525252FLogin%252525252525252525252FIndex%252525252525252525253FReturnUrl%252525252525252525253D%25252525252525252525252FLogin%25252525252525252525252FIndex%25252525252525252525253FReturnUrl%25252525252525252525253D%2525252525252525252525252FLogin%2525252525252525252525252FIndex%2525252525252525252525253FReturnUrl%2525252525252525252525253D%252525252525252525252525252FLogin%252525252525252525252525252FIndex%252525252525252525252525253FReturnUrl%252525252525252525252525253D%25252525252525252525252525252FLogin%25252525252525252525252525252FIndex%25252525252525252525252525253FReturnUrl%25252525252525252525252525253D%2525252525252525252525252525252FLogin%2525252525252525252525252525252FIndex%2525252525252525252525252525253FReturnUrl%2525252525252525252525252525253D%252525252525252525252525252525252FLogin%252525252525252525252525252525252FIndex%252525252525252525252525252525253FReturnUrl%252525252525252525252525252525253D%25252525252525252525252525252525252FLogin%25252525252525252525252525252525252FIndex%25252525252525252525252525252525253FReturnUrl%25252525252525252525252525252525253D%2525252525252525252525252525252525252FLogin%2525252525252525252525252525252525252FIndex%2525252525252525252525252525252525253FReturnUrl%2525252525252525252525252525252525253D%252525252525252525252525252525252525252FHome%252525252525252525252525252525252525252FIndex 
  </code></pre>
  
  <p>Plus the list of errors is displayed and the physical path of my controller is weird because Index is the function that should be called but it seems it's like a file</p>
  
  <pre><code>C:\Projects\vs\project\project\Login\Index
  </code></pre>
  
  <p>here is my cConfiguration function  </p>
  
  <pre><code>app.UseCookieAuthentication(new CookieAuthenticationOptions
              {
                  AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                  CookieSecure = CookieSecureOption.Always,
                  LoginPath = new PathString("/Login/Index"),
                  Provider = new CookieAuthenticationProvider
                  {
                  }
              });
  </code></pre>
  
  <p>If someone is seeing something wrong</p>
  
  <p>Edit: Here is my function Index in Login controller</p>
  
  <pre><code>    // GET: Login
      [HttpGet]
      public ActionResult Index()
      {
          return View();
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/thO1d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/thO1d.png" alt="enter image description here"></a></p>
  
  <pre><code>using Gesmar_intra.Models;
  using Gesmar_intra.Models.Entite;
  using Microsoft.AspNet.Identity.Owin;
  using System.Threading.Tasks;
  using System.Web;
  using System.Web.Mvc;
  
  namespace Gesmar_intra.Controllers
  {
      public class LoginController : Controller
      {
          protected Gesmar db = new Gesmar();
  
          private ApplicationSignInManager _signInManager;
  
          public LoginController()
          {
          }
  
          public LoginController(ApplicationSignInManager signInManager)
          {
              SignInManager = signInManager;
          }
  
          public ApplicationSignInManager SignInManager
          {
              get
              {
                  return _signInManager ?? HttpContext.GetOwinContext().Get&lt;ApplicationSignInManager&gt;();
              }
              private set 
              { 
                  _signInManager = value; 
              }
          }
  
  
          // GET: Login
          [HttpGet]
          public ActionResult Index(string returnUrl)
          {
  
              return View();
          }
  
          [HttpPost]
          public ActionResult Index(FormCollection form)
          {
              var username = Request.Form["username"];
              var password = Request.Form["password"];
              var passHash = Utilisateur.GenerateSHA256String(password);
              if (Utilisateur.CheckAccount(username, "APRRR", password))
              {
                  password = "";
              }
              var result = SignInManager.PasswordSignIn(username, password, false, shouldLockout: false);
              switch (result)
              {
                  case SignInStatus.Success:
                      return RedirectToAction("Test", "Login");
                  case SignInStatus.LockedOut:
                      return View();
                  case SignInStatus.RequiresVerification:
                      return View();
                  case SignInStatus.Failure:
                  default:
                      ModelState.AddModelError("", "Tentative de connexion non valide.");
                      return View();
              }
          }
  
          [Authorize]
          public ActionResult Test()
          {
              return View();
          }
      }
  }
  </code></pre>