How to implement Spring Security without using the WebSecurityConfigurerAdapter

preview_player
Показать описание
#springboot #springsecurity #spring #springjava #authentication #WebSecurityConfigurerAdapter
How to implement Spring Security without using the WebSecurityConfigurerAdapter
Prerequisite
1. You have spring boot application and imported to IntelliJ idea
2. Your laptop already installed PostgreSQL database
3. Your spring boot application already implemented user detail services

In this tutorial, I will use this scenario
1. show the login form
2. user insert user name and password
3. if username and password are true, show this message ("Hello Spring Security!!!")

Let's jump right in
1. add spring security dependency
2. create a security class and add @Configuration or @EnableWebSecurity
3. create a bean for the password encoder(i am using BCryptPasswordEncoder)
4. create a bean authentication manager
5. create a bean security filter chain
6. try to run the app

Succeed, happy learning and happy sharing!!!

Рекомендации по теме
Комментарии
Автор

i don't see you use autowired userDetailsService in configuration fiile, so how spring security check the username and password passed ?

tunamusic
Автор

or Spring security automatically implemented that, it knows that ?

tunamusic