انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-051-L02

التحقق من الرموز في كل مكان

  • الدرس 2 من 5
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

make every service verify tokens itself.

الموضوعات المخطط لها

  • 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.
تفاصيل المخطط المبدئي

عرض عملي

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

plus an audience validator.

اختبر فهمك

Why validate audience?

أظهر الإجابة

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

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.