Package fr.enedis.chutney.security
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
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.oauth2.jwt.JwtDecoderjwtDecoder(JwtUtil jwtUtil) jwtUtil(ChutneyJwtProperties chutneyJwtProperties) oAuth2TokenAuthenticationFilter(JwtUtil jwtUtil, AuthenticationService authenticationService) org.springframework.security.web.SecurityFilterChainsecurityFilterChain(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)
-
Field Details
-
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
-