Package org.trustdeck.configuration
Class SecurityConfig
java.lang.Object
org.trustdeck.configuration.SecurityConfig
This class is used to define security settings for keycloak and other custom security options.
- Author:
- Eric Wündisch and Armin Müller
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.web.access.AccessDeniedHandlerOverwrites the AccessDeniedHandler with a new CustomAccessDeniedHandler.org.springframework.security.web.AuthenticationEntryPointOverwrites the AuthenticationEntryPoint with a new CustomAuthenticationEntryPointHandler.org.springframework.web.cors.CorsConfigurationSourceDefines CORS settings (cf.org.springframework.security.web.SecurityFilterChainfilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) Chain for filtering secured requests.protected org.springframework.security.web.authentication.session.SessionAuthenticationStrategyOverwrites the SessionAuthenticationStrategy object with a new RegisterSessionAuthenticationStrategy object.
-
Constructor Details
-
SecurityConfig
public SecurityConfig()
-
-
Method Details
-
corsConfigurationSource
@Bean public org.springframework.web.cors.CorsConfigurationSource corsConfigurationSource()Defines CORS settings (cf. Spring: CORS).- Returns:
- the CORS configuration source
-
filterChain
@Bean public org.springframework.security.web.SecurityFilterChain filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception Chain for filtering secured requests.- Parameters:
http- the HTTP request object in a secured manner- Returns:
- the security filter chain
- Throws:
Exception- forwardedExceptions from the configuration process
-
authenticationEntryPoint
@Bean public org.springframework.security.web.AuthenticationEntryPoint authenticationEntryPoint()Overwrites the AuthenticationEntryPoint with a new CustomAuthenticationEntryPointHandler.- Returns:
- the authentication entry-point handler
-
accessDeniedHandler
@Bean public org.springframework.security.web.access.AccessDeniedHandler accessDeniedHandler()Overwrites the AccessDeniedHandler with a new CustomAccessDeniedHandler.- Returns:
- the overwritten access denied handler
-
sessionAuthenticationStrategy
@Bean protected org.springframework.security.web.authentication.session.SessionAuthenticationStrategy sessionAuthenticationStrategy()Overwrites the SessionAuthenticationStrategy object with a new RegisterSessionAuthenticationStrategy object.- Returns:
- the new RegisterSessionAuthenticationStrategy
-