Summary

In this chapter, you've learned how to add a security layer to your backend server, which allows you to authenticate users and authorize their actions. Application security is a big and important topic, which, if done incorrectly, can expose your application data and your users' privacy to attacks and leakage. Authentication and authorization can help you make sure that users can only do what you have approved. ASP.NET Core provides the identity infrastructure, which takes advantage of the EF Core DbContext and adds necessary entities to your data model. After you enabled the identity infrastructure, I showed you how to add authentication and generate a JWT that holds the user's claims. Afterwards, you saw how to use these claims ...

Get Hands-On Full-Stack Web Development with ASP.NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.