Class WebSecurityConfiguration
java.lang.Object
com.unosquare.carmigo.configuration.WebSecurityConfiguration
@Configuration
@EnableMethodSecurity
@EnableWebSecurity
public class WebSecurityConfiguration
extends Object
Web security configuration.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.security.authentication.AuthenticationManager
authenticationManager
(org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration authenticationConfiguration) protected org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
protected org.springframework.web.cors.CorsConfigurationSource
protected org.springframework.security.web.SecurityFilterChain
filterChain
(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) Security layer filter which allows some endpoints depending on the authority.
-
Constructor Details
-
WebSecurityConfiguration
public WebSecurityConfiguration()
-
-
Method Details
-
filterChain
@Bean protected org.springframework.security.web.SecurityFilterChain filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity) throws Exception Security layer filter which allows some endpoints depending on the authority. Endpoints not listed below are restricted by default.- Parameters:
httpSecurity
- HTTP web based security.- Returns:
- a
SecurityFilterChain
which is passed to next Spring filter. - Throws:
Exception
- application halts if it does not go according to the plan.
-
authenticationManager
@Bean protected org.springframework.security.authentication.AuthenticationManager authenticationManager(org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration authenticationConfiguration) throws Exception - Throws:
Exception
-
bCryptPasswordEncoder
@Bean protected org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder bCryptPasswordEncoder() -
corsFilter
@Bean protected org.springframework.web.cors.CorsConfigurationSource corsFilter()
-