r/SpringBoot • • Jul 25 '23

Every Spring Security tutorial leads to deprecated code

Beginner spring learner, created some basic crud app using Spring Data JPA when I decided to learn spring security every tutorial leads to deprecated code.

Even tutorials as late as Jan 2023 Even updated methods such as .authorizeHttpRequest() shown as “deprecated and marked for removal”. I’m so lost and have no idea how to study spring security as even these “updated” methods are already considered deprecated where do I learn the latest Spring Security as a beginner.

74 Upvotes

12 comments sorted by

13

u/MartinPeterBauer Jul 25 '23

I feel your pain. We Upgraded Our apps recently to latetest Version of spring Security and it took me ages To-Do it.

The best source was the section in spring Security on how to migrate to 6.0

12

u/smokemonstr Jul 25 '23

Try the official docs and guides

9

u/the-twitchy-nut Jul 25 '23

Unfortunately this is the way to go. Unfortunately because I do not find them very user-friendly, but a mixture of spring basics (di, ioc, container, beans) and spring security specifics will help you understand how it all works

2

u/[deleted] Jul 25 '23

Check out Den Vega on YouTube he is a spring developer advocate if I have it right in mind and he has a great playlist on what changed on spring boot 3.

And do not worry the concepts are mainly still the same so it is no like what you watched is completely worthless.

It just take time until you have a picture on how some things work.

You can also watch amigoscode he also has a nice tutorial for spring boot 3 and spring security 6

And he also has a “short” video on how the different components for spring security works.

And like mentioned above the official docs are also a possible knowledge source, but I myself prefer to watch some things first and get a little bit of a feeling on how things work and then read the docs to put everything together, but the spring docs looks a lot better now then before :)

2

u/ConsoleAppender Jul 25 '23

Great guy, i follow him on Twitter

2

u/Lost_D4L Jul 26 '23

I felt that man, I suggest as u/smokemonstr said official docs but also this blog https://www.bezkoder.com/spring-boot-jwt-authentication/, last updated was on this June.

1

u/MGelit Aug 06 '23

if you look hard enough and go through spring docs you should be able to find an up to date configuration

1

u/karthgamer1209 Sep 01 '23

If you like video courses, Chad Darby recently updated his course for Spring Boot 3. It includes new code for Spring Security and I noticed that IntelliJ did not give any deprecation warnings.

Also, check out Josh Long. https://joshlong.com. He is Spring Guru and Spring Developer Evanglist. He has good up-to-date videos on everything Spring.

0

u/[deleted] Jul 26 '23

[deleted]

1

u/lulzForMoney Jul 27 '23

This man is the best!

1

u/[deleted] Jul 27 '23

yap, its a good fellow, also i've bought some books from him