Instantly share code, notes, and snippets.

Embed
What would you like to do?
Configuring the cookie
services.AddIdentity<ApplicationUser, IdentityRole>(config => {
config.Password.RequireDigit = false;
config.Password.RequiredLength = 3;
config.Password.RequireLowercase = false;
config.Password.RequireNonAlphanumeric = false;
config.Password.RequireUppercase = false;
//Does not work in Core 2.1.
//config.Cookies.ApplicationCookie.LoginPath = "/Account/Login";
})
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
//New configuration
services.ConfigureApplicationCookie(options => options.AccessDeniedPath = "/Account/Login");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment