r/SpringBoot • u/Far-Hold7417 • 19m ago
Question Spring Security, looking for help (JWT and Logout)
Hello everyone,
I am trying to finish a small SPA for a couple of friends. It's meant to replace a small, ancient desktop app. Less than 30 users. Yeah, I know, laughably tiny. But an SPA makes sense, because of the requirements. I'm using React, Java with Spring and MySql. Most core features are implemted, tested and work. The only thing missing - besides deployment, obviously - is authentication. This is where I am stuck. I am trying to use Spring Security, but:
- Allmost all tutorials online seem outdated (I keep seeing redacted warnings)
- I need a simple authenication method. Everyone is recommending JWT. Unfortunately, no one explains how to code a log out. I understand that JWTs expire, and the best way to have a logout is by removing the token from the front end state. But what is the best way to deal with JWT in the BE? Blacklist? Refresh? Is JWT even the best strategy here? Why cant I find Infos about session cookies? Is my google fu really that bad? (apparently, yes)
All I need is good resource. A book would be great, a blog video or repo would be fine too. I read a book from O'Reily and unfortunately, it answered none of my questions. Did a Udemy course, and guess what, not a single word about about log out strategies. I am about ready to give up and redo the entire BE in node.
Thanks in advance for any help.
•
u/tushari25 10m ago
Cfbr