How to change C# Identity Login page default route

Amir

I created a new project using Microsoft.Aspnet.Identity.samples for my authentication system.

As you know Visual Studio adds AccountController automatically to the project.

I just edited the Login action route using [Route("login")] attribute.

I added another Controller to my project called Dashboard with an Index method. Then I added an [Authorize] attribute to my dashboard controller.

When I call the URL https://localhost/Dashboard/Index and my request is not authenticated, the project authomaticaly redirects to https://localhost/Account/Login?ReturnUrl=%2Fdashboard and as I said I changed the Login route then my project gives me an error.

How can I change the default login URL?

Amir

At the file Startup.Auth.cs is a method called ConfigureAuth you can change the login path default to your custom route.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

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

how to change the default login page of wordpress from wp-login.php to custom login page?

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

How to change login route name

How do I change the ASP.NET MVC default login page to login by username instead of email address?

How to change Laravel 5.2 change login route?

dotnet core authorize always redirect to identity default login page

Laravel How to route Voyager login page?

How to change sub directory folder to default login page in PHP using htaccess

How to fix navigation route from protected route to login page?

How to change the metric of an OpenVPN client default route

How to override default Spring Boot Login page?

How to change default login URL in Laravel 5?

How to change Default login button in FBSDKLoginButton in ios?

How to change default Laravel Auth login view

Change default login page UI in asp.net

How to change user login credentials in identity asp.net mvc?

How to change Firebase user login identity from command line (CLI)?

How to change response.menu for login page?

how to change the default redirect page of a url in sitemap in another page in C# asp.net

LARAVEL 5.2 - How to access login page as default page

Updating default front-end design of Identity Login Page in .NET core

Changing the default login route in Laravel

Change default login URL

How to change default web page to open in browser

How to change the default version of gcc man page?

How to change default template options of a Geb Page?

how to change adobe reader default Page Display?

symfony route redirecting to login page