Skip to content

Abdelrhman-Khaled1/Spring-Security-with-Jwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Authentication and Authorization Example

This project demonstrates a simple authentication and authorization system using Spring Boot, JWT, and Spring Security. It includes endpoints for user registration, login, and accessing secured resources based on user roles.

Features

  • User Signup and Login: Users can register and log in to get a JWT token.
  • JWT-based Authentication: Secures endpoints using JWT tokens.
  • Role-based Authorization: Access control using roles (e.g., USER, ADMIN).
  • Spring Security: Handles authentication and authorization.

Technologies Used

  • Spring Boot
  • Spring Security
  • JWT (JSON Web Tokens)
  • MySql Database (or replace with your preferred DB)
  • Lombok (for reducing boilerplate code)
  • Maven (for dependency management)

Getting Started

Prerequisites

  • Java 17+
  • Maven
  • IDE (e.g., IntelliJ IDEA, Eclipse)
  • Postman or cURL (for testing APIs)
  • Running the Application

Clone the repository:

git clone <repository-url>
cd <repository-folder>

Build the project:

mvn clean install

Run the application:

mvn spring-boot:run

The application will be available at: http://localhost:8080

API Endpoints on postman

JWT security.postman_collection.json

About

All you need to kickstart your spring-security-app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages