This is a simple Spring Boot project demonstrating OAuth2 login with Google and GitHub providers.
✅ Perfect for learning
✅ Clean and minimal codebase
✅ Ready to showcase in your resume & GitHub profile 🚀
- 🔒 OAuth2 login with Google and GitHub
- 👤 Fetch and display user profile:
- Name
- Profile Picture
- Login Provider (Google/GitHub)
- 🚀 Automatic redirect to profile page after login
- ✅ Easy to extend (add more providers or custom flows)
- Java 17
- Spring Boot 3.x
- Spring Security
- Thymeleaf (for basic frontend templates)
- Maven
git clone https://github.com/your-username/oauth2-demo.git
cd oauth2-demo-
Go to Google Developer Console.
-
Create a new OAuth 2.0 Client ID.
-
Set Authorized Redirect URI to:
http://localhost:8080/login/oauth2/code/google👉 GitHub
-
Go to GitHub Developer Settings.
-
Create a new OAuth App.
-
Set Authorization callback URL to:
http://localhost:8080/login/oauth2/code/githubspring:
security:
oauth2:
client:
registration:
google:
client-id: YOUR_GOOGLE_CLIENT_ID
client-secret: YOUR_GOOGLE_CLIENT_SECRET
github:
client-id: YOUR_GITHUB_CLIENT_ID
client-secret: YOUR_GITHUB_CLIENT_SECRET
./mvnw spring-boot:run
Visit: http://localhost:8080- Telusko tutorials --> https://www.youtube.com/watch?v=xAaGxhDiGg8