Class SecurityConfig
java.lang.Object
edu.ntnu.idatt2106_2023_06.backend.config.SecurityConfig
Configuration class for Spring Security. Enables Web Security and provides a SecurityFilterChain bean.
Uses a JwtAuthenticationFilter for authentication and an AuthenticationProvider for authentication management.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.config.annotation.WebMvcConfigurer
Configures CORS mapping for the application.org.springframework.security.web.SecurityFilterChain
securityFilterChain
(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Configures the security filter chain.
-
Constructor Details
-
SecurityConfig
public SecurityConfig()
-
-
Method Details
-
securityFilterChain
@Bean public org.springframework.security.web.SecurityFilterChain securityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception Configures the security filter chain.- Parameters:
http
- HttpSecurity object used for configuration- Returns:
- A SecurityFilterChain object
- Throws:
Exception
-
corsConfigurer
@Bean public org.springframework.web.servlet.config.annotation.WebMvcConfigurer corsConfigurer()Configures CORS mapping for the application.- Returns:
- A WebMvcConfigurer object
-