0

I trying to build up simple ASP.NET vNext application.

I have simple client-side html code:

<!DOCTYPE html>
<html>
<body>
<form action="/Home/Login" method="post">
    Login: <input type="text" name="login"><br>
    Password: <input type="text" name="password"><br>
    <input type="submit" value="Submit">
</form>
</body>
</html>

And I have simple server-side code to handle POST action:

    [HttpPost]
    [AllowAnonymous]
    public IActionResult Login(string login, string password)
    {
        if (Validate(login, password))
        {
            var claims = new[] { new Claim(ClaimTypes.Name, login) };

            var identity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationType);

            Context.Response.SignIn(identity);

            return RedirectToAction("Index", "Home");
        }

        return RedirectToAction("Login", "Home");
    }

With Windows/IIS Express it works fine, with Debian/Kestrel it not works, server method Login in not invoked.

So, my question is - how make it work with Debian?

DavidG
  • 113,891
  • 12
  • 217
  • 223
brewerof
  • 92
  • 2
  • 7
  • 1
    "Debian/Kestrel it not works, server method Login in not invoked." Much more information, pls. – Andy V Mar 17 '15 at 13:51
  • I make http post call to the Login method, but Login method in my Home controller is not invoking. I started experimenting with content-type - with text/plain it working, with application/x-www-form-urlencoded not – brewerof Mar 17 '15 at 14:34
  • what about using `@Html.BeginForm` to generate the form element, will it work? – Ricky Mar 19 '15 at 09:09
  • just in case is a path issue, change `
    ` to this `
    ` ~ added.
    – Bart Calixto Apr 07 '15 at 20:29
  • @brewerof: what if you comment out all the code except the redirect? My guess is your post could just raise an error that causes the pipeline to fail. – Wiktor Zychla Nov 28 '15 at 21:00

0 Answers0