Skip to content

Commit fba7ab9

Browse files
committed
chore: update readme
1 parent 520d683 commit fba7ab9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,40 @@
22

33
This is a minimal Spring Boot application built with standard best practices. It includes JWT bearer token authentication via Spring Security, supports auto-reloading .env configuration, and provides clean, self-documented APIs using Swagger/OpenAPI. Designed as a lightweight foundation for scalable, secure RESTful services.
44

5+
## Prerequisites
6+
7+
This project uses JWTs signed with **asymmetric encryption** (e.g., RSA).
8+
You need to generate a **public/private key pair** and place them in the default dir
9+
10+
```bash
11+
src/main/resources/certs/
12+
```
13+
14+
or you can custom the dir through application.properties
15+
16+
```bash
17+
# JWT
18+
rsa.key.private=${RSA_KEY_PRIVATE:classpath:certs/private_key.pem}
19+
rsa.key.public=${RSA_KEY_PUBLIC:classpath:certs/public_key.pem}
20+
```
21+
22+
### Required Files
23+
24+
- 🔐 `private_key.pem` — used to **sign** the JWT
25+
- 🔓 `public_key.pem` — used to **verify** the JWT
26+
27+
### 🔧 Generate Keys with OpenSSL
28+
29+
If you don't already have the keys, you can generate them using the following commands:
30+
31+
```bash
32+
# Generate private key (2048-bit RSA)
33+
openssl genrsa -out private.key 2048
34+
35+
# Extract the corresponding public key
36+
openssl rsa -in private.key -pubout -out public.key
37+
```
38+
539
## Features
640

741
### ✅ JWT Authentication using Spring Security And Oauth2 Resource Server

0 commit comments

Comments
 (0)