Skip to content

ConfigureApplicationCookie does not work with AddDefaultIdentity #5828

@wutever0

Description

@wutever0

Using ConfigureApplicationCookie to change the LoginPath only works with AddIdentity but not with AddDefaultIdentity, even after adding the configuration after AddDefaultIdentity as per #1414 .

            services.AddDefaultIdentity<IdentityUser>(); //Redirects to Account/Login
            //services.AddIdentity<IdentityUser, IdentityRole>(); //Redirects to Account/LoginRegister

            services.Configure<IdentityOptions>(options =>
            {
                // Password settings.
                options.Password.RequireDigit = false;
                options.Password.RequireLowercase = false;
                
                .....

                // User settings.
                options.User.AllowedUserNameCharacters =
                "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+";
                options.User.RequireUniqueEmail = false;
            });

            services.ConfigureApplicationCookie(options =>
            {
                options.LoginPath = $"/Identity/Account/LoginRegister";
            });

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions