Class SecurityConfig

java.lang.Object
org.trustdeck.configuration.SecurityConfig

@Configuration @EnableWebSecurity public class SecurityConfig extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.security.web.access.AccessDeniedHandler
    Overwrites the AccessDeniedHandler with a new CustomAccessDeniedHandler.
    org.springframework.security.web.AuthenticationEntryPoint
    Overwrites the AuthenticationEntryPoint with a new CustomAuthenticationEntryPointHandler.
    org.springframework.web.cors.CorsConfigurationSource
    Defines CORS settings (cf.
    org.springframework.security.web.SecurityFilterChain
    filterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
    Chain for filtering secured requests.
    protected org.springframework.security.web.authentication.session.SessionAuthenticationStrategy
    Overwrites the SessionAuthenticationStrategy object with a new RegisterSessionAuthenticationStrategy object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 - forwarded Exceptions 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