From the course: Building and Securing Restful APIs in .NET
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Enabling ASP.NET Identity for APIs - .NET Tutorial
From the course: Building and Securing Restful APIs in .NET
Enabling ASP.NET Identity for APIs
- [Instructor] We're going to look at another option, a little richer than our API Key Example for authenticating users. And we're going to use the built-in Identity Model within ASP.NET Core built on Entity Framework. So to start, we're going to do our dotnet add package, as we've got some additional packages we need to add. So it's going to be Microsoft.aspnetcore.identity.entityframeworkcore. And that's going to give us everything we need to leverage our database as our store for our user information and give us the ability to authenticate users. You can also add Manage Roles in there as well. It's all built on the ASP.NET Identity Model. So there's lots of documentation around that. We're going to go back, way back to our database context that we haven't worked on for a while. So we're going to go from the generic DbContext to this Identity, spell it right, IdentityDbContext of IdentityUser. We've got a couple of name spaces that got added up there for us from…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Authentication options2m 41s
-
(Locked)
Securing the data in transit and at rest2m 20s
-
(Locked)
Securing APIs with API key6m 21s
-
(Locked)
Checking for API keys5m 56s
-
(Locked)
Securing APIs with a token3m 26s
-
(Locked)
Enabling ASP.NET Identity for APIs4m 34s
-
(Locked)
Enforcing and validating token identity2m 17s
-
(Locked)
Testing identity APIs4m 33s
-
(Locked)
Using proxies for authentication1m 32s
-
(Locked)
Using OAuth providers for tokens2m 34s
-
(Locked)
-
-