Skip to content

dharmendra9847/spring-security-jwt-oauth2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 Spring Boot REST API with JWT & OAuth2 Security

A secure RESTful API built using Spring Boot and Spring Security, implementing JWT Authentication and OAuth2 Login (Google/GitHub).

This project demonstrates how to build production-ready backend services with secure authentication and authorization.


🚀 Features

  • ✅ RESTful API (CRUD Operations)
  • 🔐 Secure Authentication using JWT
  • 🌐 OAuth2 Login (Google & GitHub)
  • 🔑 Role-Based Authorization (RBAC)
  • 🧾 Global Exception Handling
  • ✅ Input Validation (Hibernate Validator)
  • 📦 Layered Architecture (Controller → Service → Repository)
  • 🛢️ Database Integration (MySQL / H2)

🛠️ Tech Stack

  • Java 17
  • Spring Boot
  • Spring Security
  • JWT (JSON Web Token)
  • OAuth2 Client
  • Spring Data JPA (Hibernate)
  • MySQL / H2 Database
  • Maven
  • Lombok

📂 Project Structure

com.example.securityapp │ ├── controller/ # Handles HTTP requests ├── service/ # Business logic layer ├── repository/ # Database access layer ├── entity/ # JPA entities ├── dto/ # Request/Response models ├── security/ # JWT & OAuth2 configuration ├── config/ # Application configuration ├── exception/ # Global exception handler └── util/ # Utility/helper classes


📬 API Testing

Use Postman or any REST client:

Example:

GET /api/accounts
POST /api/users

🎯 Key Features

  • Scalable architecture
  • Service discovery using Eureka
  • Centralized configuration
  • API Gateway routing
  • Independent deployment

👨‍💻 Author

Dharmendra Kumar Java Backend Developer

About

No description, website, or topics provided.

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors