انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهJNR-038-L04

التحقق من الرموز بشكل صحيح

  • الدرس 4 من 7
  • Junior
في هذا الدرس 4 موضوعات

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

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

في هذا الدرس

list every check a server must make on a token.

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

  • Verify the signature with the expected key and the expected algorithm; never trust the token's own alg, and reject alg: none.
  • Check iss equals your issuer and aud includes your API.
  • Check exp (and nbf if used), allowing only a tiny clock skew.
  • Use a well-tested library (Spring's resource server uses Nimbus); never hand-write validation.
  • Keep signing keys secret (shared secret) or the private key private (asymmetric).
تفاصيل المخطط المبدئي

عرض عملي

a checklist: signature, algorithm, issuer, audience, expiry, then roles.

اختبر فهمك

Why reject alg: none?

أظهر الإجابة

It means "unsigned", so anyone could forge a token.

التطبيق

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

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

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

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