Skip to main content

Section 17 · Stage 4: Build Applications

Spring Security & Authentication

Protect your APIs: password hashing, sign-in with JWT, roles and permissions, and the common security mistakes to avoid.

What you will be able to do

  • Explain authentication vs authorisation and how the Spring Security filter chain works
  • Store passwords safely with BCrypt and build sign-up and login endpoints
  • Protect a REST API with stateless JWT authentication
  • Restrict endpoints and data by role and by owner
  • Configure CORS and avoid the common web security mistakes
  • Secure ShopLite so customers and admins see only what they should

What you will learn

  1. 17.1Security Basics7 lessons
  2. 17.2How Spring Security Works7 lessons
  3. 17.3Users & Password Storage7 lessons
  4. 17.4HTTP Basic & Sessions6 lessons
  5. 17.5JWT Authentication8 lessons
  6. 17.6Roles & Permissions7 lessons
  7. 17.7CORS & Browser Clients6 lessons
  8. 17.8Common Security Mistakes8 lessons
  9. 17.9Security Mini Project: Secure ShopLite3 lessons

    Bring everything together: sign-up, JWT login and role-based access in the finished, documented ShopLite API.

    1. Documenting secured endpoints in Swagger UI45 min
    2. Practice: Spring Security review50 min
    3. Project: Secure ShopLite90 min