A JWT carries identity and role claims from an identity provider to an API. After login, the browser attaches the token to API requests; the gateway verifies its signature before allowing them through. section 11.3.2
A secure JWT check should:
- Verify the signature using public keys fetched from the identity provider’s JWKS endpoint. section 11.3.2
- Check the exp claim so an expired token is rejected. section 11.3.2
- Pin the allowed algorithm; accepting an attacker-selected algorithm can enable forged tokens. section 11.3.2
Reading is not verifying
Decoding a token to read a user ID does not establish that it is trustworthy. A forged token could claim admin status, so backend routes must authorize requests using a cryptographically verified token—not a role supplied by the user or a hidden frontend button. section 11.3.2 section 11.6
Figure 11.3 The IdP issues the "Royal Seal" (JWT), which the API Gateway verifies to ensure the user is who they claim to be.
The diagram traces the JWT from identity provider to API gateway and shows where verification fits. section 11.3.2












