A complete authentication system built with Spring Boot, supporting traditional email/password login as well as OAuth2 social login via Google and GitHub.
- User registration with email and password
- Secure login with email and password
- OAuth2 login with Google
- OAuth2 login with GitHub
- Password encryption (BCrypt)
- Session/JWT-based authentication
- Centralized exception handling
- Backend: Java, Spring Boot, Spring Security 6
- Database: PostgreSQL
- Auth: OAuth2 (Google, GitHub), Spring Data JPA
- Build Tool: Maven
- Java 17+
- Maven
- PostgreSQL
-
Clone the repository
git clone https://github.com/SharwanKunwar/full-auth-system.git cd full-auth-system -
Configure your database and OAuth2 credentials in
application.properties(orapplication.yml) -
Run the application
mvn spring-boot:run
You'll need to register OAuth2 apps with Google and GitHub to get your client-id and client-secret:
Add the credentials to your application config under spring.security.oauth2.client.registration.
This project is open source and available under the MIT License.