Skip to content

Latest commit

 

History

History
63 lines (40 loc) · 1.82 KB

README.md

File metadata and controls

63 lines (40 loc) · 1.82 KB

Authentication API

Java Spring JWT

This project is an API built using Java, Java Spring, Flyway Migrations, SQL as the database, and Spring Security and JWT for authentication control.

Table of Contents

Installation

  1. Clone the repository:
git clone https://github.com/valeriasouza28/api-simples-spring-security-jwt.git
  1. Install dependencies with Maven

  2. Install SQL

Usage

  1. Start the application with Maven
  2. The API will be accessible at http://localhost:8080

API Endpoints

The API provides the following endpoints:

GET /product - Retrieve a list of all products. (all authenticated users)

POST /product - Register a new product (ADMIN access required).

POST /auth/login - Login into the App

POST /auth/register - Register a new user into the App

Authentication

The API uses Spring Security for authentication control. The following roles are available:

USER -> Standard user role for logged-in users.
ADMIN -> Admin role for managing partners (registering new partners).

To access protected endpoints as an ADMIN user, provide the appropriate authentication credentials in the request header.

Database

The project utilizes SQL as the database. The necessary database migrations are managed using Flyway.