التحقق من الرموز في كل مكان
في هذا الدرس 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
inventorymust not be accepted bypayments. - Never trust a header such as
X-User-Idset by the gateway unless the network path guarantees it and the token is still verified. - Keep tokens short-lived; cache JWKS with rotation support.
تفاصيل المخطط المبدئي
عرض عملي
spring.security.oauth2.resourceserver.jwt:
issuer-uri: https://auth.shop.example/realms/shopplus an audience validator.
اختبر فهمك
Why validate audience?
أظهر الإجابة
A token meant for one service must not work on another.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.