Class ChutneyWebSecurityConfig

java.lang.Object
fr.enedis.chutney.security.ChutneyWebSecurityConfig

@Configuration @EnableWebSecurity @EnableMethodSecurity @EnableConfigurationProperties({org.springframework.boot.autoconfigure.security.oauth2.server.servlet.OAuth2AuthorizationServerProperties.class,SsoOpenIdConnectConfigProperties.class}) @ConditionalOnProperty(value="chutney.security.enabled", havingValue="true", matchIfMissing=true) public class ChutneyWebSecurityConfig extends Object
  • Field Details

    • actuatorBaseUrl

      @Value("${management.endpoints.web.base-path:/actuator}") protected String actuatorBaseUrl
  • Constructor Details

    • ChutneyWebSecurityConfig

      public ChutneyWebSecurityConfig()
  • Method Details

    • jwtUtil

      @Bean public JwtUtil jwtUtil(ChutneyJwtProperties chutneyJwtProperties) throws com.nimbusds.jose.JOSEException
      Throws:
      com.nimbusds.jose.JOSEException
    • oAuth2TokenAuthenticationFilter

      @Bean public OAuth2TokenAuthenticationFilter oAuth2TokenAuthenticationFilter(JwtUtil jwtUtil, AuthenticationService authenticationService)
    • jwtDecoder

      @Bean public org.springframework.security.oauth2.jwt.JwtDecoder jwtDecoder(JwtUtil jwtUtil) throws com.nimbusds.jose.JOSEException
      Throws:
      com.nimbusds.jose.JOSEException
    • securityFilterChain

      @Bean public org.springframework.security.web.SecurityFilterChain securityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http, org.springframework.security.authentication.AuthenticationManagerResolver<jakarta.servlet.http.HttpServletRequest> tokenAuthenticationManagerResolver, OAuth2TokenAuthenticationFilter oAuth2TokenAuthenticationFilter, JwtUtil jwtUtil, org.springframework.web.cors.CorsConfigurationSource corsConfigurationSource) throws Exception
      Throws:
      Exception