المصادقة عند الحافة
في هذا الدرس 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).
تفاصيل المخطط المبدئي
عرض عملي
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.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.