I have a very basic authentication setup:
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie();
}
}
Now when the MVC ChallengeResult
is returned (with a AuthenticationProperties
argument):
public class HomeController : Controller
{
public IActionResult Index()
{
if (!User.Identity.IsAuthenticated)
{
return Challenge(new AuthenticationProperties
{
IsPersistent = true
});
}
else
{
return View();
}
}
}
The request is redirected to /Account/Login
and to the following action method:
Issue: the original assignment of IsPersistent = true
in the Index()
action method is missing when the execution reach the Login()
action method.
The App is built in: .NET Core 3.1