Custom Login Page

Sometimes you need to customize the login page of your application by including additional text or graphics. In order to make your custom login page you need to create your own version of Login.cshtml file.

Knowledge Requirements

The cshtml pages are written using a ASP.NET Razor syntax.

In order to customize the login page you need to know HTML. You might also need to use CSS and C#.

Steps

  1. Copy Login.cshtml into a new file, e.g. MyLogin.cshtml

  2. Customize the contents of your new file

  3. Modify your Startup.cs file to point to your new login page:

    app.UseCookieAuthentication(new CookieAuthenticationOptions
    {
        LoginPath = new PathString("/MyLogin")
    });
    

    This way the application will redirect you to your customized login page instead of the default one.