Skip to content

This repository contains a robust Spring Boot REST API for user authentication ๐Ÿ”. Experience robust user authentication in your Spring Boot REST API ! Safely manage user details, encrypt them, and store securely in PostgreSQL. Receive a JSON Web Token (JWT) upon successful authentication, empowering you to make authorized requests and filter REST

License

Notifications You must be signed in to change notification settings

Wikkiee/QuickzAuth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


QuizkAuth Spring-Boot REST API

License

Table of Contents

Overview

QuizkAuth is a Java Maven-based Spring Boot REST API for robust authentication and authorization. The application integrates seamlessly with Spring modules, including Spring Security, Spring JPA, and utilizes PostgreSQL for efficient data storage. Key dependencies encompass Lombok, JSON Web Token (JWT), and JJWT Jackson.

Security Features

The core security revolves around a meticulously configured security filter chain. Ingress requests undergo thorough scrutiny, and unauthorized access to routes results in a precise 403 error. Two designated open routes ("/api/v1/auth/register" and "/api/v1/auth/authenticate") facilitate streamlined user registration and login processes.

Authentication and Authorization Flow

Upon initializing the application, incoming requests traverse a comprehensive security filter. The application adeptly handles encryption and decryption of credentials based on request type. For login requests, it meticulously checks the database for user data, while registration requests securely store encrypted data. Following the completion of these processes, the application generates a JWT containing pertinent information, which is promptly dispatched to the client.

API Endpoints

Register User

POST /api/v1/auth/register

Request Body

{
  "username": "exampleUser",
  "password": "securePassword",
  "email": "user@example.com"
}

Response

{
  "token": "eyJhbGciOiJIUzI1NiIsIn..."
}

Authenticate User

POST /api/v1/auth/authenticate

Request Body

{
  "username": "exampleUser",
  "password": "securePassword"
}

Response

{
  "token": "eyJhbGciOiJIUzI1NiIsIn..."
}

Test Endpoint

GET /api/v1/auth/test

Response

Hello there

Getting Started

Follow these steps to set up and run QuizkAuth Spring-Boot REST API locally:

  1. Clone the Repository:

    git clone https://github.com/your-username/quizkauth.git
  2. Configure Application Properties: Create an application.properties file in the src/main/resources directory with the provided dummy configurations.

    spring.datasource.driver-class-name=org.postgresql.Driver
    spring.datasource.url=jdbc:postgresql://localhost:5432/quizkauthdb
    spring.datasource.username=postgres
    spring.datasource.password=password
    spring.jpa.hibernate.ddl-auto=update
    spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
    spring.jpa.open-in-view=false

    Customize the values as per your PostgreSQL setup.

  3. Build with Maven:

    cd quizkauth
    mvn clean install
  4. Run the Application:

    mvn spring-boot:run

    The application will be accessible at http://localhost:8080.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Feel free to contribute! Check out the Contributing Guidelines for more information.

Contact

About

This repository contains a robust Spring Boot REST API for user authentication ๐Ÿ”. Experience robust user authentication in your Spring Boot REST API ! Safely manage user details, encrypt them, and store securely in PostgreSQL. Receive a JSON Web Token (JWT) upon successful authentication, empowering you to make authorized requests and filter REST

Topics

Resources

License

Stars

Watchers

Forks

Languages