The first request hit the API and failed. The external load balancer wasn’t passing the OAuth 2.0 token. Everything stopped.
OAuth 2.0 with an external load balancer is simple in theory: the client sends a token, the server validates it, traffic flows. In practice, mistakes here cause downtime, broken integrations, and security gaps. The load balancer is often the first choke point. Whether you use AWS Elastic Load Balancing, Google Cloud Load Balancing, or NGINX, it must be configured to forward headers intact.
Start with the basics: OAuth 2.0 depends on the Authorization header. Many external load balancers drop or overwrite headers if rules aren’t explicit. Ensure the configuration preserves all HTTP headers, including Authorization and any custom ones needed for token introspection.
TLS termination is another critical point. When the external load balancer terminates SSL, it must pass the encrypted data to the backend without stripping necessary request information. For OAuth 2.0, ensure HSTS, strong ciphers, and no downgrade paths.
Session affinity can break token validation. OAuth 2.0 access tokens are stateless, but authorization servers may require refresh token flows that rely on consistent backend routing. If your external load balancer uses round robin, token refresh requests can land on a server without state. Configure sticky sessions when needed or design the backend to be fully stateless.