Class SecurityConfig
java.lang.Object
com.dada.banking_project.security.SecurityConfig
This is the main configuration class for security in the application. It enables web security,
sets up the password encoder, and sets up the security filter chain.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.authentication.AuthenticationManager
authenticationManager
(org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration authenticationConfiguration) Bean definition for AuthenticationManagerorg.springframework.security.crypto.password.PasswordEncoder
encoder()
Bean definition for PasswordEncoderprotected org.springframework.security.web.SecurityFilterChain
filterChain
(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Bean definition for SecurityFilterChain
-
Constructor Details
-
SecurityConfig
public SecurityConfig()
-
-
Method Details
-
encoder
@Bean public org.springframework.security.crypto.password.PasswordEncoder encoder()Bean definition for PasswordEncoder- Returns:
- an instance of the DelegatingPasswordEncoder
-
authenticationManager
@Bean public org.springframework.security.authentication.AuthenticationManager authenticationManager(org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration authenticationConfiguration) throws Exception Bean definition for AuthenticationManager- Parameters:
authenticationConfiguration
- the instance of AuthenticationConfiguration- Returns:
- an instance of the AuthenticationManager
- Throws:
Exception
- if there is an issue getting the instance of the AuthenticationManager
-
filterChain
@Bean protected org.springframework.security.web.SecurityFilterChain filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception Bean definition for SecurityFilterChain- Parameters:
http
- the instance of HttpSecurity- Returns:
- an instance of the SecurityFilterChain
- Throws:
Exception
- if there is an issue building the SecurityFilterChain
-