Member-only story
Authentication and Authorization with Angular and NestJS

Authentication and Authorization are possibly the most important concepts when it comes to application development.
In simple terms, authentication is the process of verifying who a user is, while authorization is the process of verifying what they have access to.
Auth0 has a great real-world comparison for these concepts “When you go through security in an airport, you show your ID to authenticate your identity. Then, when you arrive at the gate, you present your boarding pass to the flight attendant, so they can authorize you to board your flight and allow access to the plane”. No matter whether you’re building something a small side project or a large global SaaS application, you’ll eventually need to consider your Authentication and Authorization strategy. Whilst this concept sounds complex and time-consuming, as it's some of the most widely completed pieces of work there’s a HUGE array of articles, NPM Packages, and third-party identity platforms that can make this easy for you. However, you can 100% do this yourself. Which I’ll show you through this article.
We’ll be using Angular as a front end and NestJS as a backend. However, these concepts can be transferred to pretty much all stacks.