Project details:
- ASP.NET Core 2.2 MVC
- Identity
I created an own login view. Actually if I call a view, for which I have to be authorized (by authorize attribute), it will automatically redirected to the login view. But at the moment it's "/Identity/Account/Login". But I want, that my own login view is shown. How can I do that?
I already tried this within startup.cs:
services.AddDefaultIdentity<ApplicationUser>(config => { config.SignIn.RequireConfirmedEmail = true; })
.AddDefaultUI(UIFramework.Bootstrap4).AddEntityFrameworkStores<ApplicationDbContext>();
services.Configure<IdentityOptions>(options => { options.User.RequireUniqueEmail = true; });
services.ConfigureApplicationCookie(options =>
{
options.Cookie.Name = "auth_cookie";
options.AccessDeniedPath = "/Account/Login";
options.LoginPath = "/Account/Login";
options.LogoutPath = "/Account/LogOff";
options.Cookie.HttpOnly = true;
options.ExpireTimeSpan = TimeSpan.FromMinutes(60);
options.ReturnUrlParameter = CookieAuthenticationDefaults.ReturnUrlParameter;
options.SlidingExpiration = true;
});
cshtml) as needed or theAccountcontroller itself to return some view(?). - EdSF