Welcome to the Spring Boot 3, Spring Security 6, and JWT Token Authentication project. This project demonstrates how to integrate Spring Boot, Spring Security, and JWT (JSON Web Token) for secure user authentication and authorization.
- Introduction
- Features
- Technologies Used
- Getting Started
- Configuration
- Usage
- Endpoints
- Contributing
- Contact
The Spring Boot 3, Spring Security 6, and JWT Token Authentication project provides a practical example of user authentication and authorization using Spring Boot and JWT. It showcases how to implement a secure authentication system with role-based access control.
- User registration and login with JWT-based authentication.
- Role-based authorization for controlling user access to different parts of the application.
- Secure password hashing and salting using industry best practices.
- Integration with PostgreSQL database for storing user information.
: Programming language for building the application.
: Framework for creating production-ready Spring applications.
: Framework for securing Spring applications.
: Token-based authentication using JSON Web Tokens.
: Database for storing user-related data.
Follow these steps to set up and run the project on your local machine:
- Clone the repository:
git clone https://github.com/GustavoRuiz0/spring-boot-3-spring-security6-jwt-token.git
- Navigate to the project directory:
cd spring-boot-3-spring-security6-jwt-token
- Update the database configuration in
application.properties
file. - Build the project:
./mvnw clean install
(or equivalent for Windows:mvnw.cmd clean install
) - Run the application:
./mvnw spring-boot:run
(or equivalent for Windows:mvnw.cmd spring-boot:run
)
- Database Configuration: Update the
application.properties
file with your PostgreSQL database credentials.
- Register a new user using the
POST /auth/register
endpoint. - Obtain a JWT by logging in using the
POST /auth/login
endpoint. - Include the JWT in the headers of protected endpoints for authorized access.
POST /auth/register
: Register a new user.POST /auth/login
: Obtain a JWT by logging in.- More endpoints for specific resources can be added as per your application's requirements.
Contributions are welcome! If you'd like to contribute, please fork the repository and create a pull request.
Connect with the project author on LinkedIn for any questions or suggestions.
License: This project is licensed under the terms of the GNU General Public License (GPL).