Skip to content

Angular 17 JWT Authentication example - Token Based Authentication & Role Based Authorization example with HttpOnly Cookie and Rest API

Notifications You must be signed in to change notification settings

AlteriosLeGris/angular-17-jwt-auth

 
 

Repository files navigation

Angular 17 JWT Authentication & Authorization example with Rest API

Build Angular 17 JWT Authentication & Authorization example with Rest Api, HttpOnly Cookie and JWT (including HttpInterceptor, Router & Form Validation).

  • JWT Authentication Flow for User Registration (Signup) & User Login
  • Project Structure with HttpInterceptor, Router
  • Way to implement HttpInterceptor
  • How to store JWT token in HttpOnly Cookie
  • Creating Login, Signup Components with Form Validation
  • Angular Components for accessing protected Resources
  • How to add a dynamic Navigation Bar to Angular App
  • Working with Browser Session Storage

Flow for User Registration and User Login

For JWT – Token based Authentication with Rest API, we’re gonna call 2 endpoints:

  • POST api/auth/signup for User Registration
  • POST api/auth/signin for User Login
  • POST api/auth/signout for User Logout

You can take a look at following flow to have an overview of Requests and Responses that Angular 17 JWT Authentication & Authorization Client will make or receive.

angular-17-jwt-authentication-authorization-flow

Angular JWT App Diagram with Router and HttpInterceptor

angular-17-jwt-authentication

For more detail, please visit the tutorial:

Angular 17 JWT Authentication & Authorization with Web API example

Angular 17 Logout when Token is expired

Angular Refresh Token with Interceptor & JWT example

With Spring Boot back-end

Angular + Spring Boot: JWT Authentication and Authorization example

With Node.js Express back-end

Angular + Node.js Express: JWT Authentication and Authorization example

Run ng serve --port 8081 for a dev server. Navigate to http://localhost:8081/.

More practice

Angular 16 CRUD example with Rest API

Angular 16 Pagination example

Angular 16 File upload example with Progress bar

Angular 16 Form Validation example

Fullstack with Node:

Angular 16 + Node Express + MySQL example

Angular 16 + Node Express + PostgreSQL example

Angular 16 + Node Express + MongoDB example

Angular 16 + Node Express: File upload example

Fullstack with Spring Boot:

Angular 16 + Spring Boot example

Angular 16 + Spring Boot + MySQL example

Angular 16 + Spring Boot + PostgreSQL example

Angular 16 + Spring Boot + MongoDB example

Angular 16 + Spring Boot: File upload example

Fullstack with Django:

Angular + Django example

Angular + Django + MySQL

Angular + Django + PostgreSQL

Angular + Django + MongoDB

Serverless with Firebase:

Angular 16 Firebase CRUD with Realtime DataBase

Angular 16 Firestore CRUD example

Angular 16 Firebase Storage: File Upload/Display/Delete example

Integration (run back-end & front-end on same server/port)

How to integrate Angular with Node Restful Services

How to Integrate Angular with Spring Boot Rest API

About

Angular 17 JWT Authentication example - Token Based Authentication & Role Based Authorization example with HttpOnly Cookie and Rest API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 68.9%
  • HTML 26.3%
  • CSS 4.8%