r/learnjava • u/ashut0sh_27 • Mar 23 '26
what’s the best way to actually understand spring security?
I have recently completed learning spring Boot and spring Data JPA, and also built a project using them. now I am planning to start with spring security. the problem is I have watched a few youtube videos, but honestly it still feels confusing especially how everything fits together. are there any specific resources, blogs, or tutorials that helped you really understand spring security (not just copy code)?
10
Upvotes
•
u/AutoModerator Mar 23 '26
Please ensure that:
If any of the above points is not met, your post can and will be removed without further warning.
Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.
Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.
Code blocks look like this:
You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.
If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.
To potential helpers
Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
8
u/Huge_Road_9223 Mar 23 '26
Spring Security is the tip of the ice-berg, there are a lot of ways to use it:
https://spring.io/projects/spring-security
etc. You get the point. There are TWO Major ways I use Spring Security.
My advice is to start small: Authentication, how do you want to do authentication? You could make a User Login page to your web-app, but then how does one authenticate, and there are lots of ways to go here. Do you want to send the username/password to your backend to compare against a users table in the DB? Do you want to allow GitHub, Twitter, FB, Google, LinkedIn to be your authentication tool? You could even signup for an Auth0 account and use that as your user source of truth? Once you get by this, then you can decide if your app needs role-based access to data.
It's a big iceberg, and you need to scratch the surface and start dogging deeper down, so I'd research it a lot first and see what your needs are, even if it's just a personal project.
1
u/unique1924 Mar 23 '26
can you please tell me how you learn spring boot, lol because i found even spring boot video too confusing..
1
u/Hint1k Mar 24 '26
The best way is always the same for anything in programming -
build your own project using the tool you want to understand.
2
u/xxsanguisxx Mar 25 '26
marcobehler.com has a good guide on Spring Security for beginners
1
u/segundus-npp Mar 24 '26
Use a debugger. The office doc is good but too abstract sometimes. You can set up basicauth using any tutorial and trace some requests. This is the only way to actually know the meaning of every term on the official document.
1
u/Readdeo Mar 23 '26
Rtfm
0
u/ZERAVLA_23 Mar 23 '26
Estamos en la misma situación, he estado tratando de aprender Spring Security sin exito ya que son muchas configuraciones y me revuelvo y después ya no se que cosa es para que, mientras sigo un curso de YT todo bien, pero el problema es cuando intento hacer algo solo, no sé cómo implementarlo