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

المصادقة عند الحافة

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

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

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

في هذا الدرس

validate tokens at the gateway without making services blindly trust callers.

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

  • The gateway can validate the JWT (signature, expiry, issuer) and reject bad requests early.
  • It forwards identity to services (the token itself, or trusted headers).
  • Services must still check authorization for their own data and must not accept unauthenticated requests just because they are "internal".
  • Network isolation: only the gateway is exposed; services listen on a private network.
  • Use the token's audience and scopes; do not trust identity headers that clients could set (strip them at the edge).
تفاصيل المخطط المبدئي

عرض عملي

java
http.oauth2ResourceServer(o -> o.jwt(Customizer.withDefaults()))
    .authorizeExchange(a -> a.pathMatchers("/api/products/**").permitAll()
                              .anyExchange().authenticated());

اختبر فهمك

Why must services still validate identity?

أظهر الإجابة

A gateway bypass or misroute would otherwise expose them; defense in depth.

التطبيق

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

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

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

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