- Overview
- Security Features
- Authentication and Authorization Flow
- API Endpoints
- Getting Started
- Additional Information
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.
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.
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.
POST /api/v1/auth/register
{
"username": "exampleUser",
"password": "securePassword",
"email": "[email protected]"
}
{
"token": "eyJhbGciOiJIUzI1NiIsIn..."
}
POST /api/v1/auth/authenticate
{
"username": "exampleUser",
"password": "securePassword"
}
{
"token": "eyJhbGciOiJIUzI1NiIsIn..."
}
GET /api/v1/auth/test
Hello there
Follow these steps to set up and run QuizkAuth Spring-Boot REST API locally:
-
Clone the Repository:
git clone https://github.com/your-username/quizkauth.git
-
Configure Application Properties: Create an
application.properties
file in thesrc/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.
-
Build with Maven:
cd quizkauth mvn clean install
-
Run the Application:
mvn spring-boot:run
The application will be accessible at http://localhost:8080.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to contribute! Check out the Contributing Guidelines for more information.
- Discord: #wikkie
- LinkedIn: Vignesh Mayilsamy
- Email: [email protected]