All Questions
Api Gateway hard

Your API uses JWTs for stateless authentication. However, large tokens (containing many claims) are causing 'Header Too Large' errors. How does the 'Phantom Token Pattern' resolve this without losing statelessness in the backend?

  1. A By compressing the JWT using GZIP before sending it to the client, which is then unzipped by the Gateway.
  2. B The client receives an Opaque/Reference token. The Gateway intercepts it, retrieves the full JWT from a high-speed cache (like Redis), and replaces the Opaque token with the JWT before forwarding it to the backend services.
  3. C By splitting the JWT into multiple smaller headers (e.g., X-JWT-1, X-JWT-2) that are merged by the microservices.
  4. D By moving the authentication data from the Header to the HTTP Body for all GET requests.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions