Package com.endurancetrio.app.config
Class AppSecurityConfig
java.lang.Object
com.endurancetrio.app.config.AppSecurityConfig
Security configuration for the EnduranceTrio application.
-
Constructor Summary
ConstructorsConstructorDescriptionAppSecurityConfig(String allowedOrigins, EnduranceTrioAuthProvider authProvider, EnduranceTrioAuthEntryPoint entryPoint) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.authentication.AuthenticationManagerorg.springframework.web.cors.CorsConfigurationSourceCreates and configures a CORS (Cross-Origin Resource Sharing) configuration source bean.org.springframework.security.web.SecurityFilterChainsecurityFilterChainAPI(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Security filter chain for API endpoints.org.springframework.security.web.SecurityFilterChainsecurityFilterChainWeb(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Security filter chain for UI (Thymeleaf) pages.
-
Constructor Details
-
AppSecurityConfig
@Autowired public AppSecurityConfig(@Value("${cors.allowed-origins}") String allowedOrigins, EnduranceTrioAuthProvider authProvider, EnduranceTrioAuthEntryPoint entryPoint)
-
-
Method Details
-
corsConfigurationSource
@Bean public org.springframework.web.cors.CorsConfigurationSource corsConfigurationSource()Creates and configures a CORS (Cross-Origin Resource Sharing) configuration source bean. This bean defines CORS policies for the application, allowing or restricting cross-origin requests.- Returns:
CorsConfigurationSourcea fully configured CORS configuration source registered for all application endpoints
-
securityFilterChainAPI
@Bean @Order(1) public org.springframework.security.web.SecurityFilterChain securityFilterChainAPI(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Security filter chain for API endpoints.- Parameters:
http- the HttpSecurity to configure- Returns:
- the configured SecurityFilterChain
-
securityFilterChainWeb
@Bean @Order(2) public org.springframework.security.web.SecurityFilterChain securityFilterChainWeb(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Security filter chain for UI (Thymeleaf) pages.- Parameters:
http- the HttpSecurity to configure- Returns:
- the configured SecurityFilterChain
-
authenticationManager
@Bean public org.springframework.security.authentication.AuthenticationManager authenticationManager() -
authenticationFilter
-