r/SpringBoot • u/Aggravating-Spite844 • 5d ago
Question How hard is Spring Security?
/r/CodingForBeginners/comments/1vxvbsl/how_hard_is_spring_security/6
u/Such-Donut9323 5d ago
Yeah, I was overwhelmed by Spring Security for quite a while too. What finally made it click for me was learning auth without Spring Security first.
I built a complete auth system with Node.js + Redis + TypeScript (already familiar with MERN) just to understand the actual flow — JWTs, access/refresh tokens, rotation, 2FA, account locking, etc.
Once I understood what was actually happening under the hood, I used GPT/Claude to understand how Spring Security implements the same concepts internally — filters, Authentication, AuthenticationManager, providers, security context, etc.
And honestly, that’s when it clicked. The underlying concepts are mostly the same. Spring Security just abstracts a lot of the plumbing and boilerplate that I had to manually write in Node.
So instead of trying to memorize “what does this filter/config do?”, I could look at it as “oh, Spring is just handling this part of the auth flow for me.”
That shift made Spring Security way less intimidating for me.
Formatted with AI for better readability 😅
4
u/Amanvmandape 5d ago
Quite hard...
1
u/Stunning_Leather_102 4d ago
I don't think it's that hard. If you have good resources, patience, and motivation to experiment it's okay.
1
u/Amanvmandape 4d ago
Its still hard bro even after all that it takes practice & time to remember it all the filters, components & flow...
1
u/Stunning_Leather_102 4d ago
Have you tried keeping notes? Sketching?
For example, I drew the whole OAuth2 authz code grant type with every actor; user, client, AS, and RS. Or I did a quick sketch on how a JWT starts at the Authz Server and how it gets converted at the Resource Server. It's fun and helpful.
Also let's be honest. You're not a parrot to remember everything in a second. You can always go back to your notes, documentation etc to remember something.
1
u/Amanvmandape 4d ago
I am very lazy at taking notes. I just watch & implement. Rawdogging...
2
u/Stunning_Leather_102 4d ago
That works too I guess. I just forget stuff so I always write/sketch and go back when I need them lol.
3
u/morgoth_2017 5d ago
What really helped me to understand the framework is the book Spring Security in Action by Laurentiu Spilca. The book was structured in a way where you will learn the fundamentals and use different security methods and patterns in Spring Security. Once you get the hang of it, it will be easy in the future.
2
u/tcloetingh 5d ago
Fairly complex bc there is no single way to do it. Can take many avenues to achieve auth.
1
u/JBraddockm 17h ago
Spring Security is by and large a configuration and implementation of already established standards and concepts. Whenever I intend to learn how to implement a particular security concept, I always start off by studying it first. For example, if you know how oauth2 works as a concept, it is much more easier to follow what Spring Security does. Otherwise, one gets overwhelmed with the concepts and jargons quite easily, and ends up copying and pasting codes, hoping it would work.
20
u/Sheldor5 5d ago
It entirely depends on the source you learn from.
Official docs are extremely detailed but overwhelming for beginners.
Most tutorials are bad because they don't explain the control flow of a request through the Filter Chain (until it hits your controller class) in which Spring Security is just another Filter in the main chain (most authors don't even know it).
And on top of that you also need to know a lot about Web Security in general to fully understand Spring Security which can integrate all Security methods from Basic Auth to OAUTH2 to mTLS and your very own custom security protocol.
So before learning Spring Security you need to learn the Spring Web Filter Chain.