https://github.com/fernanda-kipper/auth-api
This repository contains a simple Java Spring project that implements authentication and authorization using Spring Security
https://github.com/fernanda-kipper/auth-api
java spring spring-boot spring-security
Last synced: 1 day ago
JSON representation
This repository contains a simple Java Spring project that implements authentication and authorization using Spring Security
- Host: GitHub
- URL: https://github.com/fernanda-kipper/auth-api
- Owner: Fernanda-Kipper
- Created: 2023-06-25T17:41:48.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-25T20:32:03.000Z (almost 2 years ago)
- Last Synced: 2025-05-07T21:44:23.191Z (8 days ago)
- Topics: java, spring, spring-boot, spring-security
- Language: Java
- Homepage:
- Size: 69.3 KB
- Stars: 262
- Watchers: 2
- Forks: 79
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Authentication API



This project is an API built using **Java, Java Spring, Flyway Migrations, PostgresSQL as the database, and Spring Security and JWT for authentication control.**
The API was developed for my [Youtube Tutorial](https://www.youtube.com/watch?v=5w-YCcOjPD0), to demonstrate how to configure Authenticatio and Authorization in Spring application using Spring Security.
## Table of Contents
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [API Endpoints](#api-endpoints)
- [Authentication](#authentication)
- [Database](#database)
- [Contributing](#contributing)## Installation
1. Clone the repository:
```bash
git clone https://github.com/Fernanda-Kipper/auth-api.git
```2. Install dependencies with Maven
3. Install [PostgresSQL](https://www.postgresql.org/)
## 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:```markdown
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 [PostgresSQL](https://www.postgresql.org/) as the database. The necessary database migrations are managed using Flyway.## Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request to the repository.
When contributing to this project, please follow the existing code style, [commit conventions](https://www.conventionalcommits.org/en/v1.0.0/), and submit your changes in a separate branch.