title: asp.net mvc identity form doesn't post to allowanonymous action
body: <p>I am learning identity and I have a problem that seems like nobody has. My login to application works just fine if I put in the action by itself, but if I try to make it like usually logins should be - with form and post. Then my form data just doesn't make it to the action. I have a breakpoint in that action and the code just never hits. I don't have things like AntiForgeryToken, because I just want to hit the breakpoint.</p>
  
  <p><strong>Login Action</strong></p>
  
  <pre><code>[HttpPost]
  [AllowAnonymous]
          public virtual ActionResult Login(UserViewModel user, string returnUrl)
          {
              if (!ModelState.IsValid)
                  return RedirectToAction(MVC.Home.ActionNames.Index, MVC.Home.Name);
  
              var result = SignInManager.PasswordSignIn(
                  user.Name, user.Password, false, shouldLockout: false);
  
              switch (result)
              {
                  case SignInStatus.Success:
                      return Redirect(returnUrl);
  
                  case SignInStatus.LockedOut:
  
                  case SignInStatus.RequiresVerification:
  
                  case SignInStatus.Failure:
                  default:
                      ModelState.AddModelError("", "Invalid login attempt");
                      return RedirectToAction(MVC.Home.ActionNames.Index, MVC.Home.Name);
              }
          }
  </code></pre>
  
  <p><strong>Login HTML</strong></p>
  
  <pre><code>    @using (Html.BeginForm("Login", "Admin", new { returnUrl = ViewBag.returnUrl }, FormMethod.Post ))
  {
      @Html.ValidationSummary(true)
  
      &lt;div class="form-group"&gt;
          @Html.LabelFor(m =&gt; m.Name)
          &lt;div class="input-group"&gt;
              @Html.TextBoxFor(m =&gt; m.Name, new {@class = "form-control", placeholder = "Jméno"})
              &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-user"&gt;&lt;/i&gt;&lt;/span&gt;
          &lt;/div&gt;
          @Html.ValidationMessageFor(m =&gt; m.Name)
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
          @Html.LabelFor(m =&gt; m.Password)
          &lt;div class="input-group"&gt;
              @Html.PasswordFor(m =&gt; m.Password, new { @class = "form-control", placeholder = "Heslo" })
              &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-lock"&gt;&lt;/i&gt;&lt;/span&gt;
          &lt;/div&gt;
          @Html.ValidationMessageFor(m =&gt; m.Password)
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
          @Html.LabelFor(m =&gt; m.ConfirmPassword)
          &lt;div class="input-group"&gt;
              @Html.PasswordFor(m =&gt; m.ConfirmPassword, new { @class = "form-control", placeholder = "Potvrdit heslo" })
              &lt;span class="input-group-addon"&gt;&lt;i class="fa fa-lock"&gt;&lt;/i&gt;&lt;/span&gt;
          &lt;/div&gt;
          @Html.ValidationMessageFor(m =&gt; m.ConfirmPassword)
      &lt;/div&gt;
  
      &lt;input type="submit" value="Přihlásit se" class="btn btn-default"/&gt;
  }
  </code></pre>
  
  <p><strong>Startup.Auth</strong></p>
  
  <pre><code>public void ConfigureAuth(IAppBuilder app)
      {
          app.CreatePerOwinContext(ApplicationDbContext.Create);
          app.CreatePerOwinContext&lt;ApplicationUserManager&gt;(ApplicationUserManager.Create);
          app.CreatePerOwinContext&lt;ApplicationSignInManager&gt;(ApplicationSignInManager.Create);
  
          app.UseCookieAuthentication(new CookieAuthenticationOptions
          {
              AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
              LoginPath = new PathString($"/{MVC.Admin.Name}/{MVC.Admin.ActionNames.Login}")
          });
      }
  </code></pre>