An open API service indexing awesome lists of open source software.

https://github.com/nadimnesar/spring-security-jwt-auth-module

Ready-to-use starter module for authentication and authorization (JWT-based) using Spring Boot and Spring Security.
https://github.com/nadimnesar/spring-security-jwt-auth-module

gradle h2-database java jwt-authentication jwt-authorization restful-api spring-boot spring-security

Last synced: 2 months ago
JSON representation

Ready-to-use starter module for authentication and authorization (JWT-based) using Spring Boot and Spring Security.

Awesome Lists containing this project

README

          

# Spring Security JWT Auth Module

[![Status](https://img.shields.io/badge/status-active-success.svg)]()
[![GitHub Issues](https://img.shields.io/github/issues/nadimnesar/spring-security-jwt-authentication-module.svg)](https://github.com/nadimnesar/spring-security-jwt-authentication-module/issues)
[![GitHub Pull Requests](https://img.shields.io/github/issues-pr/nadimnesar/spring-security-jwt-authentication-module.svg)](https://github.com/nadimnesar/spring-security-jwt-authentication-module/pulls)
[![Commit Activity](https://img.shields.io/github/commit-activity/m/nadimnesar/spring-security-jwt-authentication-module.svg)](https://github.com/nadimnesar/spring-security-jwt-authentication-module/commits)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)
---
This project is a ready-to-use starter module for authentication and authorization (JSON Web Token-based) using Spring Boot and Spring Security. It avoids deprecated methods, ensuring compatibility and security.

## Prerequisite

- JDK 21
- Spring Boot >= 3.3.1
- Spring Security >= 6.3.1
- H2 Database
- Gradle (Groovy)
- Base64 Encoded Secret Key (generate at [Base64Encode.org](https://www.base64encode.org/))

## Features

* Registration
* Login
* API method security with roles

## RESTful API Details

### Registration

- `POST /api/auth/register`
postman
- `POST /api/auth/admin/register`
postman

### Login

- `POST /api/auth/login`
postman

### Refresh Token

- `POST /api/auth/refresh`
postman

### Authorization

- `GET /api/user/`
postman
- `GET /api/admin/`
postman