مقدمة إلى Spring Security 6
استكشف المفاهيم الأساسية وبنية Spring Security 6، وافهم دوره في تأمين تطبيقات الويب.
مقدمة إلى Spring Security 6 درس مجاني في Spring Security 6 & JWT Authentication على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Spring Security 6 & JWT Authentication، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Spring Security 6 & JWT Authentication 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Welcome to Spring Security!
Time to lock down your Java apps. Spring Security 6 is the framework that handles authentication and access control so you don't roll your own.
What is Spring Security?
Spring Security is a customizable auth and access-control framework for Spring Boot apps. Authentication proves who you are; authorization decides what you can touch.
Why Security Matters
Unprotected apps invite unauthorized access, data breaches, and DoS. Spring Security gives you a battle-tested layer to shut those doors.
AuthN vs. AuthZ: Key Terms
Two terms, often confused: Authentication proves who you are (username + password), while authorization decides what you're allowed to do. Spring handles both.
Spring Security's Core Approach
Under the hood, Spring Security runs as a chain of servlet filters. Every request passes through them, each one handling one job: auth, authz, sessions.
The Security Filter Chain
The FilterChainProxy intercepts each HTTP request and runs it through an ordered series of security filters before it ever hits your controllers.
Understanding the SecurityContext
Once authenticated, a user's identity and roles live in the SecurityContext, managed by SecurityContextHolder. That's how Spring knows who's logged in.
Default Spring Boot Security
Just add spring-boot-starter-security and Boot locks down every endpoint with a generated login page — security on by default, no config needed.
Default Security in Action
Add Spring Security to a minimal Boot app and hit the root URL — it redirects you straight to a generated login page. The code below shows the setup.
package com.coddykit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class SecurityIntroApplication {
public static void main(String[] args) {
SpringApplication.run(SecurityIntroApplication.class, args);
}
@GetMapping("/")
public String home() {
return "Welcome to a secured application!";
}
}Check Your Understanding
Let's test your grasp of the core concepts we've covered.
Recap: Spring Security Basics
Recap: Spring Security guards Java apps, separates authentication from authorization, and runs every request through a filter chain — protected out of the box with Boot.
تعلم Java مع معلم ذكاء اصطناعي — مجانًا
اكتب وقم بتشغيل أكوادك الفعلية في المتصفح، واحصل على مساعدة فورية من معلم ذكاء اصطناعي متاح 24/7، واستمر من حيث توقفت على الويب أو في التطبيق.
- الدورات
- 12
- الدروس
- 48
الأسئلة الشائعة
هل درس «مقدمة إلى Spring Security 6» مجاني؟
نعم — نص درس «مقدمة إلى Spring Security 6» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Spring Security 6 & JWT Authentication، انتقل إلى CoddyKit PRO. تتضمن دورة Spring Security 6 & JWT Authentication 4 دروس في المجموع.
ماذا ستتعلم في «مقدمة إلى Spring Security 6»؟
استكشف المفاهيم الأساسية وبنية Spring Security 6، وافهم دوره في تأمين تطبيقات الويب. تتمرن على Spring Security 6 & JWT Authentication مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Spring Security 6 & JWT Authentication؟
لا تُشترط خبرة سابقة. Spring Security 6 & JWT Authentication على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «مقدمة إلى Spring Security 6»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Spring Security 6 & JWT Authentication هذا؟
نعم. كل درس في Spring Security 6 & JWT Authentication يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- مقدمة إلى Spring Security 6
- إعداد المشروع والتبعيات
- مصادقة المستخدمين داخل الذاكرة
- فهم سلسلة عوامل تصفية Spring Security