Securing Microservices under 40 minutes with MicroProfile & Keycloak
summary
Builds a runnable demo (GitHub microsServices-keycloak-demo) of two Java microservices (speakers and sessions) plus an Angular SPA using Keycloak in a Docker container on port 88088 and a conference realm. Uses MicroProfile JWT with @LoginConfig(mp-jwt) and @RolesAllowed to read JWKS from /realms/conference/protocol/openid-connect, maps username to UPN and groups to a groups claim, and verifies tokens’ signature and expiry. Shows role enforcement (unauthorized creates 403) and SSO for the SPA, so authentication is centralized and token validation is handled by the runtime.
AI-written summary · about
chapters (12)
- 0:00Introduction and setup
- 2:31Security challenges in microservices
- 4:17Keycloak for identity management
- 7:05OpenID Connect fundamentals
- 8:51Securing stateless microservices
- 11:40MicroProfile JWT basics
- 14:10Live demo overview
- 21:38Configuring MicroProfile JWT
- 23:48Angular app integration
- 26:14Demo authentication flow
- 29:44Benefits of Keycloak integration
- 30:26Summary and Q&A
