From the course: Advanced Web APIs with ASP.NET Core in .NET 6

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Adding ASP.NET Core Identity

Adding ASP.NET Core Identity

- [Lecturer] So far everyone may call our API. So the next step will be to restrict that a little bit. However, in order to be able to implement that, there are some preparations which we need to take. We are using ASP.NET Core Identity which is built into ASP.NET Core. And I would like to use the Razor Pages web project to demonstrate that. If we create a new project, and it doesn't really matter whether it's a Razor Pages or a MVC project or an API project, there is this authentication type setting. And of course that's also available via the .NET CLI. And if we set that to individual accounts then ASP.NET's Core identities automatically built in. So among other things, users can register and then log in and log out. However, I would like to show you how we can add this to the existing application here. So we're using the web project, and first of all, we need a new NuGet package. And the NuGet package is called…

Contents