Skip to content

mktintumon/Springboot-JWT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot JWT Authentication with React

Implemented secure authentication using Spring Security and JWT, integrating a React frontend with protected REST APIs and token-based authorization. It implements a simple login system where users authenticate and receive a JWT token, which is then used to access protected APIs.

The goal of this project is to demonstrate secure authentication flow between a React frontend and a Spring Boot backend using JWT.


🚀 Features

  • User Login Authentication
  • JWT Token Generation
  • Secure API Access using JWT
  • Token validation using Spring Security filters
  • React frontend for login interface
  • Protected API endpoints
  • Full stack authentication flow demo

🏗️ Project Architecture

React Frontend
      │
      │ HTTP Request (Login)
      ▼
Spring Boot Backend
      │
      │ Generate JWT Token
      ▼
Client Receives Token
      │
      │ Token sent in Authorization Header
      ▼
Protected Spring Boot APIs

🛠️ Tech Stack

Backend

  • Spring Boot
  • Spring Security
  • JWT (JSON Web Token)
  • Maven
  • Java

Frontend

  • React.js
  • JavaScript
  • HTML
  • CSS
  • Axios (for API requests)

🔐 Authentication Flow

  1. User enters username and password in React login page
  2. React sends request to Spring Boot login API
  3. Spring Boot validates credentials
  4. If valid → JWT token is generated
  5. Token is sent back to React
  6. React stores the token
  7. Token is sent in Authorization Header for protected API requests

Example header:

Authorization: Bearer <JWT_TOKEN>

💡 Learning Objectives

This project demonstrates:

  • How JWT authentication works
  • Integration of Spring Security with JWT
  • Communication between React and Spring Boot
  • Securing REST APIs using token-based authentication

👨‍💻 Author

Mohit Kumar


⭐ If you found this project helpful, consider giving it a star!

About

Implemented secure authentication using Spring Security and JWT, integrating a React frontend with protected REST APIs and token-based authorization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors