I am using .NET core 2.0 with cookie authentication.
My configuration looks like this:
services
.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(options =>
{
options.ExpireTimeSpan = TimeSpan.FromDays(1);
options.SlidingExpiration = true;
options.Cookie.Name = "authtoken";
});
When I access unauthorized controller, I am being redirected to /Account/Login
In .NET Core 1.1 I was able to configure this by setting
AutomaticChallenge = false.
How can I configure this in .NET Core 2.0?
I just want my controller to return HTTP 403.