How saiupadhyayula/spring-security-oauth2-keycloak-demo works
This repository is a set of three Spring Security/Keycloak OAuth2 demos: Authorization Code, PKCE Authorization Code, and Client Credentials. The clearest end-to-end path is the PKCE Angular client configuring OAuth, requesting a protected API response, and displaying it. README documentation establishes the three grant types and realm-import capability; several implementation details, especially Client Credentials, are not shown in the excerpts, so their internal links are omitted. The map excludes build and test machinery.
Main entry points: app.component.ts Login and Display · app.module.ts Angular Module · main.ts Angular Bootstrap · HomeController.java Home Page Route
Components 20
Authorization Code Demo
- Application Entry
oauth2-authorization-code-demo/src/main/java/com/programming/techie/authcode/DemoApplication.java - Home Page Route
oauth2-authorization-code-demo/src/main/java/com/programming/techie/authcode/controller/HomeController.java - Home Template
oauth2-authorization-code-demo/src/main/resources/templates/home.html - Hello Endpoint
oauth2-authorization-code-demo/src/main/java/com/programming/techie/authcode/controller/HomeRestController.java
PKCE Demo
- Application Entry
oauth2-pkce-demo/src/main/java/com/programming/techie/pkce/Oauth2PKCEDemoApplication.java - Security Configuration
oauth2-pkce-demo/src/main/java/com/programming/techie/pkce/config/SecurityConfig.java - Angular Bootstrap
oauth2-pkce-demo/src/main/resources/frontend/src/main.ts - Angular Module
oauth2-pkce-demo/src/main/resources/frontend/src/app/app.module.ts - Route Setup
oauth2-pkce-demo/src/main/resources/frontend/src/app/app-routing.module.ts - Login and Display
oauth2-pkce-demo/src/main/resources/frontend/src/app/app.component.ts - OAuth Settings
oauth2-pkce-demo/src/main/resources/frontend/src/app/auth.config.ts - API Client
oauth2-pkce-demo/src/main/resources/frontend/src/app/app.service.ts - Environment Settings
oauth2-pkce-demo/src/main/resources/frontend/src/environments/environment.ts - Home API
oauth2-pkce-demo/src/main/java/com/programming/techie/pkce/controller/HomeRestController.java
Client Credentials Demo
- Application Entry
oauth2-client-credentials-demo/microservice-1/src/main/java/com/programming/techie/microservice1/Microservice1Application.java - Security Configuration
oauth2-client-credentials-demo/microservice-1/src/main/java/com/programming/techie/microservice1/config/SecurityConfig.java - Service Endpoint
oauth2-client-credentials-demo/microservice-1/src/main/java/com/programming/techie/microservice1/controller/Controller1.java
Identity Provider
- Keycloak Server
- Realm Configuration
realm-export.json
Other components
- User
Connections 14
- User → Home Page Route: opens page
oauth2-authorization-code-demo/src/main/java/com/programming/techie/authcode/controller/HomeController.java - Home Page Route → Home Template: returns view
oauth2-authorization-code-demo/src/main/java/com/programming/techie/authcode/controller/HomeController.java - User → Hello Endpoint: requests hello
oauth2-authorization-code-demo/src/main/java/com/programming/techie/authcode/controller/HomeRestController.java - Angular Bootstrap → Angular Module: bootstraps
oauth2-pkce-demo/src/main/resources/frontend/src/main.ts - Angular Bootstrap → Environment Settings: reads settings
oauth2-pkce-demo/src/main/resources/frontend/src/main.ts - Angular Module → Login and Display: bootstraps
oauth2-pkce-demo/src/main/resources/frontend/src/app/app.module.ts - Angular Module → Route Setup: registers routes
oauth2-pkce-demo/src/main/resources/frontend/src/app/app.module.ts - Login and Display → OAuth Settings: configures OAuth
oauth2-pkce-demo/src/main/resources/frontend/src/app/app.component.ts - Login and Display → API Client: calls API client
oauth2-pkce-demo/src/main/resources/frontend/src/app/app.component.ts - API Client → Home API: requests response
oauth2-pkce-demo/src/main/resources/frontend/src/app/app.service.ts - User → Login and Display: uses client
- Login and Display → Keycloak Server: starts login
- Realm Configuration → Keycloak Server: imports realm
README.md - Service Endpoint → Keycloak Server: uses OAuth