This project is a Spring Boot application that demonstrates JSON Web Token (JWT) authentication for securing APIs.
Before you begin, make sure you have the following installed:
- Java 17 Development Kit (JDK)
- Maven
- Your preferred Integrated Development Environment (IDE)
Follow these steps to set up and run the project:
-
Clone the repository:
git clone https://github.com/deuriib/spring-boot-jwt.git
-
Navigate to the project directory:
cd spring-boot-jwt
-
Build the project with Maven:
mvn clean install
-
Run the application:
java -jar target/spring-boot-jwt-1.0.0.jar
The application will start, and you can access it at http://localhost:8080.
This project provides an authentication system using JWT. Here's how you can use it:
- Create a user by making a POST request to
/api/auth/register
with valid credentials. - Obtain a JWT token by making a POST request to
/api/auth/login
with valid credentials. - Include the obtained token in the Authorization header for subsequent protected API requests.
You can configure the application by modifying the application.properties
file.