Skip to content
CalliCoder

3-part series

Spring Security with React

Read in order — each part builds on the code from the one before it, and each is written to stand on its own if you already have the earlier pieces in place.

  1. 01 Spring Boot OAuth2 Social Login: Spring Security Tutorial Spring Boot · 15 min read Part one of a Spring Security OAuth2 example: registering the providers, mapping three different user-info payloads onto one account, and issuing your own JWT instead of holding a session.
  2. 02 Spring Boot OAuth2 Social Login: Spring Security — Part 2 Spring Boot · 13 min read The security configuration: the OAuth2 login flow end to end, a cookie-based authorization request repository so it survives a stateless backend, mapping provider profiles to one user, and issuing a JWT at the end of it.
  3. 03 Spring Boot OAuth2 Social Login: React — Part 3 Spring Boot · 13 min read The browser half of the flow: why the OAuth2 redirect cannot be an XHR call, reading the token out of the redirect URI exactly once, and the allow-list on the backend that makes the whole round trip safe.