Skip to content
Ameen Abozaid
Planned lessonMID-051-L02

Token validation everywhere

  • Lesson 2 of 5
  • Mid-level
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

make every service verify tokens itself.

Planned topics

  • The gateway is not enough: an attacker reaching a service directly bypasses it.
  • Each service validates: signature (keys from the issuer's JWKS), issuer, audience, expiry, and scopes or roles.
  • Audience matters: a token for inventory must not be accepted by payments.
  • Never trust a header such as X-User-Id set by the gateway unless the network path guarantees it and the token is still verified.
  • Keep tokens short-lived; cache JWKS with rotation support.
Draft outline details

Demonstration

yaml
spring.security.oauth2.resourceserver.jwt:
  issuer-uri: https://auth.shop.example/realms/shop

plus an audience validator.

Check your understanding

Why validate audience?

Show answer

A token meant for one service must not work on another.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.