Change default identity Login route to something custom asp.net core

DrinkBlink

I saw a lot of other threads on this but no one ever said if it is possible to just rename the endpoint route of the Identity/Account/Login to something like /Home. Is it possible to do this without removing the AddDefaultIdentity from the Startup class?

vrs

Add Role services to Identity

public void ConfigureServices(IServiceCollection services)
{
    services.AddDbContext<ApplicationDbContext>(options =>
        options.UseSqlServer(
            Configuration.GetConnectionString("DefaultConnection")));
    services.AddDefaultIdentity<IdentityUser>()
        .AddRoles<IdentityRole>()
        .AddEntityFrameworkStores<ApplicationDbContext>();

    services.AddControllersWithViews();
    services.AddRazorPages();
}

[Authorize(Roles = "Administrator")]
public class AdministrationController : Controller
{
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

ASP.NET MVC 5 custom route goes to wrong action

Custom Route Constraint with Dependency Injection in .Net Core

ASP.NET Identity rollback unverified email change

How to work with Azure AD external login with ASP.NET Idenity in Identity Server4

asp.net core route specific middleware

How fill custom class in View in asp.net core 2.1

Asp.net mvc - change default route to http://myparameter.localhost:5000/controller/action/id

Asp.net core identity: check if user is admin in cshtml

Login from external database ASP.NET Core 2.2

Identity on ASP.NET Core(3.0) not functioning when using endpoints

FullName from Identity is not working asp .net core 3.0

How to set default image in iFormFile, ASP.net Core

How to implement .Net Core Identity with custom API

Invalid Login Attempt with correct credentials ASP.NET Identity

Change the default ErrorMessage of model validation attribute asp.net core 3.1

Asp.net core 3.1 redirect empty route to default language route

Creating a Login Page in ASP.NET Core MVC

Route to /login and /{PageName} in an asp.net app not working

Custom Validator for Enum in ASP.NET Core

How to make Login as Default route in ASP.NET CORE 5.0 MVC

change identity routing in asp.net core 3.1 from Identity/Account/Register to /Register

ASP.NET Core : specify controller name for logging in using identity

How to configure endpoint route in ASP.NET Core

Something wrong with cookie authentication in ASP.NET Core MVC

ASP.Net Razor Identity

Is there a way to change the Data Type of PasswordHash from String to Byte array in Asp.Net Core Identity

How do I change the Identity authorization path in ASP.NET Core?

How to invalidate and revalidate custom claims in ASP.NET Core?

How to set default identity login page in .net core 6 mvc instead of index page in program.cs

TOP Ranking

HotTag

Archive