Course

Spring Security Foundations

Master the foundations of Spring Security. Filter chain, form login, basic auth, authentication internals, roles, permissions, authorization, and security events. The hands-on guide to securing real Spring Boot applications.

of video
4.2 h
lectures
74
sections
11

Want a mentor as well? The Academy gives you every course on Amigoscode plus code reviews, daily live calls and interview prep, for $129/month. Compare →

“Amigoscode does a pretty darned good job, and consistently too, covering Spring, and for that I'm very appreciative.”
Josh Long · Spring Developer Advocate

What you'll learn

By the end of this course

  • Spring Security Foundations. Understand the filter chain, security context, authentication providers, and how Spring Security wires everything together.
  • Form Login & Sessions. Implement login forms, manage JSESSIONID, and persist sessions in Redis or JDBC for production setups.
  • HTTP Basic Auth. Configure basic authentication, handle browser prompts, server-to-server requests, and CSRF correctly.
  • Authentication Internals. Build custom AuthenticationProviders, plug in UserDetailsService, hash passwords with BCrypt, and use the AuthenticationManager directly.
  • Roles, Permissions & Authorization. Model roles and permissions, secure endpoints with @PreAuthorize, hasAuthority, request matchers, and method security.
  • Security Events. Capture authentication and authorization events, handle them asynchronously, and audit every login attempt.

Curriculum

11 sections, 74 lectures

4.2 h of video. Open any section to see its lectures.

1Prerequisites1 min
  1. 1Recommended CoursesFree preview
2Intro15 min
  1. 1What Is Spring Security6 min
  2. 2Official Documentation4 min
  3. 3Cloning Repo (Important)6 min
  4. 4HTTP Status Codes You Need to Know
  5. 5Intro Quiz
3Form login35 min
  1. 1Section Start
  2. 2Form Login Intro4 min
  3. 3Implement Form Login7 min
  4. 4Testing Login Form5 min
  5. 5JSESSIONID5 min
  6. 6Storing JSESSIONID in Redis and JDBC6 min
  7. 7Form Login Configuration4 min
  8. 8Inspecting Filters4 min
  9. 9Form Login Quiz
  10. 10Section End
4Basic auth27 min
  1. 1Section Start
  2. 2Intro4 min
  3. 3Configure HTTP Basic6 min
  4. 4Basic Auth on the Browser5 min
  5. 5Requests from Server7 min
  6. 6Configuration and CSRF4 min
  7. 7HTTP Basic Auth Quiz
  8. 8Section End
5Authentication45 min
  1. 1Section Start
  2. 2Authentication Provider9 min
  3. 3UserDetailsService8 min
  4. 4NoOp Password7 min
  5. 5Password Hashing4 min
  6. 6Password Encoder and BCrypt8 min
  7. 7Custom DaoAuthenticationProvider4 min
  8. 8Using AuthenticationManager5 min
  9. 9Authentication Quiz
  10. 10Section End
6User details service33 min
  1. 1Section Start
  2. 2Custom UserDetailsService5 min
  3. 3ApplicationUser Class6 min
  4. 4ApplicationUser Class Annotations5 min
  5. 5Inspect Tables3 min
  6. 6Storing Users to DB4 min
  7. 7Fix loadByUsername7 min
  8. 8Testing Changes4 min
  9. 9UserDetailsService Quiz
  10. 10Section End
7Security context holder14 min
  1. 1Section Start
  2. 2SecurityContextHolder7 min
  3. 3Inspecting SecurityContextHolder4 min
  4. 4Inject Authentication in Param3 min
  5. 5SecurityContextHolder Quiz
  6. 6Section End
8Roles and permissions38 min
  1. 1Section Start
  2. 2Intro3 min
  3. 3Roles and Permissions Entities9 min
  4. 4ERD6 min
  5. 5Saving Roles and Permissions with Repositories11 min
  6. 6SimpleGrantedAuthority9 min
  7. 7Roles and Permissions Quiz
  8. 8Section End
9Authorization25 min
  1. 1Section Start
  2. 2Intro6 min
  3. 3hasAuthority5 min
  4. 4Request Matchers9 min
  5. 5Explore More Methods4 min
  6. 6Authorization Quiz
  7. 7Section End
10Security events19 min
  1. 1Section Start
  2. 2Intro2 min
  3. 3Capturing Events6 min
  4. 4Async9 min
  5. 5Exercise2 min
  6. 6Security Events Quiz
  7. 7Section End
11Outro1 min
  1. 1Feedback
  2. 2Next and Recommended Courses

Choose how you learn

Learn on your own, or with people who check your work

The course is yours to keep. The Academy is this course and every other one, plus the people who get you hired.

Spring Security Foundations

The course, on your own

  • 74 lectures, 4.2 h of video
  • Source code for everything you build
  • Subtitles on every video
  • 6 months of IntelliJ IDEA Ultimate
  • Lifetime access to the course and its updates
Recommended

The Academy

The courses, plus the people

$129/monthcancel anytime

This course, plus

  • Every course on Amigoscode 50+ in the Zero to Hired Roadmap
  • Daily live calls and 1:1 instructor time
  • Code reviews and pair programming on what you build
  • Interview prep mock interviews, System Design Lab, CV and LinkedIn review
  • Land an interview in 90 days or we coach you 1:1 free until you do.
Join the Academy

7-day money-back guarantee · Secure checkout on Skool

“Nelson was teaching 90% of my job. I was already implementing everything I learnt from it.”
MBMarlon BragaJava Full Stack Software Developer
“I was a totally different person. More confident as a developer, more prepared for my job.”
GabrielaSoftware Engineer at Mercado Livre
“I studied biomedicine and psychology. I found Nelson's Java tutorials while looking for a course for my brother. I was hooked and now here I am, a software engineer at IKEA.”
NajmaSoftware Engineer at IKEA

Read every review →

About this course

Who is this course for?

Level: Intermediate to Advanced Engineers. Watch the free preview lectures in the curriculum to see if it's right for you.

How long will it take?

There are about 4 hours of video. Most people finish in a week at 5 hours a week, plus the time you spend building along.

Can I buy this course on its own?

No. It's part of the Spring Security bundle, which includes it and the courses around it.

Should I buy the course or join the Academy?

Buy the course if you only want this topic and you learn well on your own. Join the Academy if you want to get hired or move up: you get every course on Amigoscode, this one included, plus daily live calls, code reviews and interview prep, for $129/month.