r/java • u/mateoeo_01 • Jun 19 '25
Pure JWT Authentication - Spring Boot 3.4.x
https://mediocreguy.hashnode.dev/pure-jwt-authentication-spring-boot-34xNo paywall. No ads. Everything is explained line by line. Please, read in order.
No custom filters.
No external security libraries (only Spring Boot starters).
Custom-derived security annotations for better readability.
Fine-grained control for each endpoint by leveraging method security.
Fine-tuned method security AOP pointcuts only targeting controllers without degrading the performance of the whole application.
Seamless integration with authorization Authorities functionality.
No deprecated functionality.
Deny all requests by default (as recommended by OWASP), unless explicitly allowed (using method security annotations).
Stateful Refresh Token (eligible for revocation) & Stateless Access Token.
Efficient access token generation based on the data projections.
1
u/mateoeo_01 Jun 20 '25
For the impatient people:
* The fourth subsection of the Introduction section is Expected Result, which shows what we are working towards in this article.
* In the Sources section at the end of the article, there is a link to the Gitlab project on which this article is based.
5
u/Kango_V Jun 19 '25
Wow. So much code to do JWT auth. Same thing in Micronaut requires hardly any code at all.