Introduction

Completed

This module explores how to use ASP.NET Core Identity to support authentication and authorization in an ASP.NET Core Razor Pages web app.

Note

This module uses the .NET CLI (command line interface) and Visual Studio Code or GitHub Codespaces. After completing this module, you can apply its concepts using a development environment like Visual Studio (Windows), Visual Studio for Mac (macOS), or continue development using Visual Studio Code (Windows, Linux, and macOS).

In this module, you will:

  • Configure Identity support in an existing ASP.NET Core web app.
  • Provide new user registration capabilities.
  • Extend Identity UI components.
  • Customize multi-factor sign-in capabilities.
  • Implement policy-based authorization using claims.
  • Customize and extend the underlying Identity data store.

Prerequisites

  • Experience writing C# at the beginner level
  • Experience using relational databases and SQL as a developer
  • Familiarity with Entity Framework (EF) Core migrations
  • Ability to write Razor at the beginner level
  • Familiarity with a time-based one-time password (TOTP) authenticator app, such as Microsoft Authenticator (available in the Google Play Store or the Apple App Store)

Required tools

Before you start, ensure you have the following tools installed:

Alternatively, this module includes a .devcontainer file. The .devcontainer file defines a container preconfigured with .NET 6 SDK, SQL Server, and the required extensions. We recommend this approach for the best experience.

Using the .devcontainer requires only:

If you don't want to install any local tools, you can also use the .devcontainer in GitHub Codespaces (charges might apply).

Get started

In the next unit, you'll learn about ASP.NET Core Identity architecture.