https://github.com/bezkoder/angular-10-spring-boot-jwt-authentication
Angular 10 Spring Boot JWT Authentication example with Authorization | User Registration & Login
https://github.com/bezkoder/angular-10-spring-boot-jwt-authentication
Last synced: 7 months ago
JSON representation
Angular 10 Spring Boot JWT Authentication example with Authorization | User Registration & Login
- Host: GitHub
- URL: https://github.com/bezkoder/angular-10-spring-boot-jwt-authentication
- Owner: bezkoder
- Created: 2020-12-13T01:33:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-13T01:59:48.000Z (about 5 years ago)
- Last Synced: 2025-04-14T22:39:42.745Z (9 months ago)
- Language: TypeScript
- Size: 549 KB
- Stars: 30
- Watchers: 3
- Forks: 28
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
In this tutorial, I will show you how to build a full stack Angular 10 + Spring Boot JWT Authentication example. The back-end server uses Spring Boot with Spring Security for JWT Authentication & Authorization, Spring Data JPA for interacting with database. The front-end will be built using Angular 10 with HttpInterceptor & Form validation.
## Angular 10 Spring Boot JWT Authentication example
It will be a full stack, with Spring Boot for back-end and Angular 10 for front-end. The system is secured by Spring Security with JWT Authentication.
User can signup new account, login with username & password.
Authorization by the role of the User (admin, moderator, user)
Screenshots
Here are UI screenshots of our system.
– Anyone can access a public page before logging in:

– New user registration:

– Signup Form Validation:

– After signup is successful, User can login:

-Loggedin User can access Profile page/ User page:


– This is UI for **admin**:

– If a User who doesn’t have Admin role tries to access **Admin**/**Moderator Board** page:

## Demo
This is full Angular + Spring Boot JWT authentication demo (with form validation, check signup username/email duplicates, test authorization with 3 roles: Admin, Moderator, User).
[](http://www.youtube.com/watch?v=QdXHkybzrUU)
## Flow for User Registration and User Login
The diagram shows flow for User Registration process and User Login process.

It’s not too difficult to understand. We have 2 endpoints for authentication:
* `api/auth/signup` for User Registration
* `api/auth/signin` for User Login
If Client wants to send request to protected data/endpoints, a legal JWT must be added to HTTP Authorization Header.
## Spring Boot & Spring Security for Back-end

## Angular 10 for Front-end

For more details, please visit:
[https://bezkoder.com/angular-10-spring-boot-jwt-auth/](https://bezkoder.com/angular-10-spring-boot-jwt-auth/)