Securing applications with OAuth2 and OpenID Connect using SpringSecurit
summary
Step‑by‑step demo secures a Spring Boot microservice setup using OpenID Connect for authentication and OAuth2 access tokens as JWTs for delegated authorization, integrating Keycloak, Spring Security (imperative and reactive), and Spring Cloud Gateway. Code shows route token relay, session -> token mapping, resource server JWT validation, and an Angular SPA fix using cookie CSRF tokens; logout is propagated to Keycloak via OIDC. All examples run live: login, protected GETs work, POSTs need CSRF and then succeed.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:04Application Security
- 7:13SpringSecurit
- 8:25Authentication
- 12:00OAuth Connect
- 13:00Dependencies
- 13:45KeyClock
- 15:00KeyClock integration
- 17:00Configuring the application
- 19:40Testing the application
- 20:35Behind the scenes
- 27:15Adding SpringSecurit to BookService
- 40:00Configuring the security filter chain
- 43:27Exception handling
- 46:36Propagation
- 49:33Authorization
related talks
01h 30mSecuring Microservices with Spring Cloud Security
56mSecured REST Microservices with Spring Cloud
01h 31mSecurity for Microservices with Spring and OAuth2
54mHow to secure your Spring Apps with Keycloak
54mHow to secure your Spring apps with Keycloak
50mArchitectural Patterns for Spring Security You Wish Your Tech Lead Knew
46mImplementing Microservices Security Patterns & Protocols with Spring Security
53mHow to Secure Your Spring Apps with Keycloak
