Application Security in Angular

Application Security is a chapter of the free Angular tutorial. Most real apps have users who log in, and pages or actions that only some users may open. You must know who the user is, and what that user is allowed to do, before you show private data.

What the lesson covers:

  • User Access Control: Authentication and authorization, JSON Web Tokens (JWT), an auth service with registration and login, the authentication state, storing and sending the token with an interceptor, token expiration, user roles and role-based access control, route guards, authentication errors and logout.

The lesson ends with a capstone project that combines all of these, and you can download it as a complete Angular project with a real API server that signs JWTs and checks permissions.

Every practice block runs real Angular in your browser, with a small practice server that imitates the login API.

Lessons in this section

  1. User Access Control

    Authentication and authorization in Angular: JWTs, an auth service, registration and login, token handling and expiration, interceptors, roles, route guards, error handling and logout, with a full capstone project.