https://github.com/sumitmadaan16/spring-security-demo
Spring Boot project with user registration, password encryption, and Basic Auth using Spring Security. Stateless session management, PostgreSQL integration, and clean layered architecture. Ideal for backend authentication demos.
https://github.com/sumitmadaan16/spring-security-demo
authentication backend backend-api java jwt jwt-authentication jwt-token postgresql rest-api restful-api spring-boot spring-mvc spring-security springboot
Last synced: about 2 months ago
JSON representation
Spring Boot project with user registration, password encryption, and Basic Auth using Spring Security. Stateless session management, PostgreSQL integration, and clean layered architecture. Ideal for backend authentication demos.
- Host: GitHub
- URL: https://github.com/sumitmadaan16/spring-security-demo
- Owner: sumitmadaan16
- License: mit
- Created: 2025-09-29T19:42:15.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-10-01T17:33:24.000Z (9 months ago)
- Last Synced: 2025-10-08T19:47:34.400Z (9 months ago)
- Topics: authentication, backend, backend-api, java, jwt, jwt-authentication, jwt-token, postgresql, rest-api, restful-api, spring-boot, spring-mvc, spring-security, springboot
- Language: Java
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
๐ GitHub Project Description
> ๐ Spring Security Demo โ User Registration & Authentication
> A lightweight Spring Boot application showcasing secure user registration and Basic Authentication using Spring Security. Built with a PostgreSQL backend and designed for stateless session management,
> this project demonstrates how to encrypt passwords, authenticate users, and protect endpoints with minimal configuration.
๐ Features
- โ
User registration with BCrypt password hashing
- ๐ Basic Authentication for protected endpoints
- ๐งผ Stateless session management (`SessionCreationPolicy.STATELESS`)
- ๐๏ธ PostgreSQL integration via Spring Data JPA
- ๐ง Clean architecture with service, controller, and entity layers
- ๐งช Tested using Postman
๐ ๏ธ Tech Stack
- Java 17
- Spring Boot 3.5
- Spring Security
- Spring Data JPA
- PostgreSQL
- Lombok
๐ Endpoints
| Method | Endpoint | Description | Auth Required |
|--------|--------------|----------------------------------|---------------|
| POST | `/register` | Register a new user | โ No |
| GET | `/greet` | Greet user by username | โ
Yes |
โ๏ธ Setup Instructions
1. Clone the repo
2. Create `application.properties` with your DB credentials
3. Run the app using `mvn spring-boot:run`
4. Test endpoints using Postman or curl
๐ Sample `application.properties`
```properties
spring.datasource.url=jdbc:postgresql://localhost:5432/your_db
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
```
๐จโ๐ป Author
**Sumit Madaan** โ Backend Developer & Security Enthusiast
exploring scalable backend architectures, authentication flows, and system design.