From 93271897022dae6d34c555b0eb36448f49d9d7e1 Mon Sep 17 00:00:00 2001 From: stigus Date: Fri, 20 Oct 2023 11:13:52 +0200 Subject: [PATCH] =?UTF-8?q?Endret=20SecurityConfig=20jwt=20til=20=C3=A5=20?= =?UTF-8?q?bruke=20withDefaults=20#deploy-proxy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../testnav/apps/adresseservice/config/SecurityConfig.java | 4 ++-- .../arbeidsforholdexportapi/config/SecurityConfig.java | 4 ++-- .../arbeidsforholdservice/config/SecurityConfig.java | 4 ++-- .../batchbestillingservice/config/SecurityConfig.java | 4 ++-- .../src/main/java/no/nav/dolly/config/SecurityConfig.java | 4 ++-- .../eregbatchstatusservice/config/SecurityConfig.java | 4 ++-- .../config/SecurityConfig.java | 4 ++-- .../testnorge/generernavnservice/config/SecurityConfig.java | 4 ++-- .../config/SecurityConfig.java | 4 ++-- .../generersyntameldingservice/config/SecurityConfig.java | 4 ++-- .../geografiskekodeverkservice/config/SecurityConfig.java | 4 ++-- .../helsepersonellservice/config/SecurityConfig.java | 4 ++-- .../nav/testnav/apps/hodejegeren/config/SecurityConfig.java | 4 ++-- .../config/SecurityConfig.java | 4 ++-- .../jenkinsbatchstatusservice/config/SecurityConfig.java | 4 ++-- .../testnav/joarkdokumentservice/config/SecurityConfig.java | 4 ++-- .../testnorge/miljoerservice/config/SecurityConfig.java | 4 ++-- .../mn/syntarbeidsforholdservice/config/SecurityConfig.java | 4 ++-- .../oppsummeringsdokumentservice/config/SecurityConfig.java | 4 ++-- .../organisasjonbestillingservice/config/SecurityConfig.java | 4 ++-- .../organisasjonfastedataservice/config/SecurityConfig.java | 4 ++-- .../no/nav/organisasjonforvalter/config/SecurityConfig.java | 4 ++-- .../testnorge/organisasjonmottak/config/SecurityConfig.java | 4 ++-- .../testnorge/organisasjonservice/config/SecurityConfig.java | 4 ++-- .../no/nav/registre/orgnrservice/config/SecurityConfig.java | 4 ++-- .../main/java/no/nav/pdl/forvalter/config/SecurityConfig.java | 4 ++-- .../testnav/apps/personexportapi/config/SecurityConfig.java | 4 ++-- .../testnorge/personsearchservice/config/SecurityConfig.java | 4 ++-- .../nav/testnav/apps/personservice/config/SecurityConfig.java | 4 ++-- .../testnorge/profil/config/SecurityConfiguration.java | 4 ++-- .../registre/testnorge/sykemelding/config/SecurityConfig.java | 4 ++-- .../apps/syntsykemeldingapi/config/SecurityConfig.java | 4 ++-- .../syntvedtakshistorikkservice/config/SecurityConfig.java | 4 ++-- .../java/no/nav/testnav/identpool/config/SecurityConfig.java | 4 ++-- .../main/java/no/nav/registre/tp/config/SecurityConfig.java | 4 ++-- .../testnorge/tilbakemeldingapi/config/SecurityConfig.java | 4 ++-- .../apps/tpsmessagingservice/config/SecurityConfig.java | 4 ++-- .../src/main/java/no/nav/udistub/config/SecurityConfig.java | 4 ++-- .../nav/registre/varslingerservice/config/SecurityConfig.java | 4 ++-- .../nav/testnav/libs/reactiveproxy/config/SecurityConfig.java | 3 ++- 40 files changed, 80 insertions(+), 79 deletions(-) diff --git a/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/SecurityConfig.java b/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/SecurityConfig.java index bfbd2872db7..fcbddbaf8b3 100644 --- a/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/SecurityConfig.java +++ b/apps/adresse-service/src/main/java/no/nav/testnav/apps/adresseservice/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -30,8 +31,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/arbeidsforhold-export-api/src/main/java/no/nav/no/registere/testnorge/arbeidsforholdexportapi/config/SecurityConfig.java b/apps/arbeidsforhold-export-api/src/main/java/no/nav/no/registere/testnorge/arbeidsforholdexportapi/config/SecurityConfig.java index 4ad8029350a..4a8cb1ae4a3 100644 --- a/apps/arbeidsforhold-export-api/src/main/java/no/nav/no/registere/testnorge/arbeidsforholdexportapi/config/SecurityConfig.java +++ b/apps/arbeidsforhold-export-api/src/main/java/no/nav/no/registere/testnorge/arbeidsforholdexportapi/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/SecurityConfig.java b/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/SecurityConfig.java index 49ab0aab175..f036df45948 100644 --- a/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/SecurityConfig.java +++ b/apps/arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/arbeidsforholdservice/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -31,8 +32,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/SecurityConfig.java b/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/SecurityConfig.java index 32cd0eb1517..445fc51198b 100644 --- a/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/SecurityConfig.java +++ b/apps/batch-bestilling-service/src/main/java/no/nav/registre/testnorge/batchbestillingservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/dolly-backend/src/main/java/no/nav/dolly/config/SecurityConfig.java b/apps/dolly-backend/src/main/java/no/nav/dolly/config/SecurityConfig.java index f42fc58ce07..b35e4adc845 100644 --- a/apps/dolly-backend/src/main/java/no/nav/dolly/config/SecurityConfig.java +++ b/apps/dolly-backend/src/main/java/no/nav/dolly/config/SecurityConfig.java @@ -2,6 +2,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; @@ -27,8 +28,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/SecurityConfig.java b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/SecurityConfig.java index 1f8827a51ab..ec6102ed65e 100644 --- a/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/SecurityConfig.java +++ b/apps/ereg-batch-status-service/src/main/java/no/nav/registre/testnorge/eregbatchstatusservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/SecurityConfig.java b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/SecurityConfig.java index 8c1916bc076..c46b340b94e 100644 --- a/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/SecurityConfig.java +++ b/apps/generer-arbeidsforhold-populasjon-service/src/main/java/no/nav/registre/testnav/genererarbeidsforholdpopulasjonservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -29,8 +30,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/SecurityConfig.java b/apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/SecurityConfig.java index d3074d33910..d36bdb17e42 100644 --- a/apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/SecurityConfig.java +++ b/apps/generer-navn-service/src/main/java/no/nav/registre/testnorge/generernavnservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/SecurityConfig.java b/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/SecurityConfig.java index d816bad522e..7f375e30b44 100644 --- a/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/SecurityConfig.java +++ b/apps/generer-organisasjon-populasjon-service/src/main/java/no/nav/registre/testnav/genererorganisasjonpopulasjonservice/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -31,8 +32,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/SecurityConfig.java b/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/SecurityConfig.java index ba5d4c0f263..4e39146fb0b 100644 --- a/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/SecurityConfig.java +++ b/apps/generer-synt-amelding-service/src/main/java/no/nav/registre/testnorge/generersyntameldingservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/geografiske-kodeverk-service/src/main/java/no/nav/registre/testnav/geografiskekodeverkservice/config/SecurityConfig.java b/apps/geografiske-kodeverk-service/src/main/java/no/nav/registre/testnav/geografiskekodeverkservice/config/SecurityConfig.java index a12df16bbf3..0c00757d26a 100644 --- a/apps/geografiske-kodeverk-service/src/main/java/no/nav/registre/testnav/geografiskekodeverkservice/config/SecurityConfig.java +++ b/apps/geografiske-kodeverk-service/src/main/java/no/nav/registre/testnav/geografiskekodeverkservice/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -30,8 +31,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/SecurityConfig.java b/apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/SecurityConfig.java index 36cc85e0096..71c4b77899a 100644 --- a/apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/SecurityConfig.java +++ b/apps/helsepersonell-service/src/main/java/no/nav/registre/testnorge/helsepersonellservice/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -31,8 +32,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/hodejegeren/src/main/java/no/nav/testnav/apps/hodejegeren/config/SecurityConfig.java b/apps/hodejegeren/src/main/java/no/nav/testnav/apps/hodejegeren/config/SecurityConfig.java index 0095449043f..34cdc116f83 100644 --- a/apps/hodejegeren/src/main/java/no/nav/testnav/apps/hodejegeren/config/SecurityConfig.java +++ b/apps/hodejegeren/src/main/java/no/nav/testnav/apps/hodejegeren/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.SecurityFilterChain; @@ -32,8 +33,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/inntektsmelding-generator-service/src/main/java/no/nav/registre/inntektsmeldinggeneratorservice/config/SecurityConfig.java b/apps/inntektsmelding-generator-service/src/main/java/no/nav/registre/inntektsmeldinggeneratorservice/config/SecurityConfig.java index ac472015258..468bfaf9797 100644 --- a/apps/inntektsmelding-generator-service/src/main/java/no/nav/registre/inntektsmeldinggeneratorservice/config/SecurityConfig.java +++ b/apps/inntektsmelding-generator-service/src/main/java/no/nav/registre/inntektsmeldinggeneratorservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/SecurityConfig.java b/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/SecurityConfig.java index 077cd1e8404..5b000179273 100644 --- a/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/SecurityConfig.java +++ b/apps/jenkins-batch-status-service/src/main/java/no/nav/registre/testnorge/jenkinsbatchstatusservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/SecurityConfig.java b/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/SecurityConfig.java index e79d497ca23..c79dd76bd47 100644 --- a/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/SecurityConfig.java +++ b/apps/joark-dokument-service/src/main/java/no/nav/testnav/joarkdokumentservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -27,8 +28,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/SecurityConfig.java b/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/SecurityConfig.java index 522cce01713..6f9c33b1657 100644 --- a/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/SecurityConfig.java +++ b/apps/miljoer-service/src/main/java/no/nav/registre/testnorge/miljoerservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/mn-synt-arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/mn/syntarbeidsforholdservice/config/SecurityConfig.java b/apps/mn-synt-arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/mn/syntarbeidsforholdservice/config/SecurityConfig.java index 0b881ad1a5e..7a32a601cb7 100644 --- a/apps/mn-synt-arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/mn/syntarbeidsforholdservice/config/SecurityConfig.java +++ b/apps/mn-synt-arbeidsforhold-service/src/main/java/no/nav/registre/testnorge/mn/syntarbeidsforholdservice/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -31,8 +32,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/SecurityConfig.java b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/SecurityConfig.java index b2c598bed6d..baac159e439 100644 --- a/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/SecurityConfig.java +++ b/apps/oppsummeringsdokument-service/src/main/java/no/nav/testnav/apps/oppsummeringsdokumentservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -29,8 +30,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/SecurityConfig.java b/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/SecurityConfig.java index bcb3f47ed2b..2ea35fda1cd 100644 --- a/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/SecurityConfig.java +++ b/apps/organisasjon-bestilling-service/src/main/java/no/nav/testnav/apps/organisasjonbestillingservice/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -31,8 +32,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/SecurityConfig.java b/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/SecurityConfig.java index f5974fcc567..16e870da80d 100644 --- a/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/SecurityConfig.java +++ b/apps/organisasjon-faste-data-service/src/main/java/no/nav/registre/testnorge/organisasjonfastedataservice/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -31,8 +32,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/SecurityConfig.java b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/SecurityConfig.java index e37d7b8d39a..c08b413ce91 100644 --- a/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/SecurityConfig.java +++ b/apps/organisasjon-forvalter/src/main/java/no/nav/organisasjonforvalter/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -31,8 +32,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/SecurityConfig.java b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/SecurityConfig.java index a53b1c3f170..d6bef8d9f4a 100644 --- a/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/SecurityConfig.java +++ b/apps/organisasjon-mottak-service/src/main/java/no/nav/registre/testnorge/organisasjonmottak/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/SecurityConfig.java b/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/SecurityConfig.java index 57921c31110..e117013c75a 100644 --- a/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/SecurityConfig.java +++ b/apps/organisasjon-service/src/main/java/no/nav/registre/testnorge/organisasjonservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/SecurityConfig.java b/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/SecurityConfig.java index 31d224f17b1..e14ad70d821 100644 --- a/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/SecurityConfig.java +++ b/apps/orgnummer-service/src/main/java/no/nav/registre/orgnrservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/SecurityConfig.java b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/SecurityConfig.java index 9b915bf11a9..752681c3f15 100644 --- a/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/SecurityConfig.java +++ b/apps/pdl-forvalter/src/main/java/no/nav/pdl/forvalter/config/SecurityConfig.java @@ -2,6 +2,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -26,8 +27,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/person-export-api/src/main/java/no/nav/testnav/apps/personexportapi/config/SecurityConfig.java b/apps/person-export-api/src/main/java/no/nav/testnav/apps/personexportapi/config/SecurityConfig.java index 045222f358e..acf49f5cd08 100644 --- a/apps/person-export-api/src/main/java/no/nav/testnav/apps/personexportapi/config/SecurityConfig.java +++ b/apps/person-export-api/src/main/java/no/nav/testnav/apps/personexportapi/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -29,8 +30,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/SecurityConfig.java b/apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/SecurityConfig.java index eeef554da19..4659dda6bae 100644 --- a/apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/SecurityConfig.java +++ b/apps/person-search-service/src/main/java/no/nav/registre/testnorge/personsearchservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/SecurityConfig.java b/apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/SecurityConfig.java index 778363e59c2..deabba60472 100644 --- a/apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/SecurityConfig.java +++ b/apps/person-service/src/main/java/no/nav/testnav/apps/personservice/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/SecurityConfiguration.java b/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/SecurityConfiguration.java index 5a7d19a31a3..7f467471ff1 100644 --- a/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/SecurityConfiguration.java +++ b/apps/profil-api/src/main/java/no/nav/registre/testnorge/profil/config/SecurityConfiguration.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/SecurityConfig.java b/apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/SecurityConfig.java index 67a7fdde906..bddd84ea4dc 100644 --- a/apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/SecurityConfig.java +++ b/apps/sykemelding-api/src/main/java/no/nav/registre/testnorge/sykemelding/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -31,8 +32,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/SecurityConfig.java b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/SecurityConfig.java index 55de701547e..f96bdfd2631 100644 --- a/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/SecurityConfig.java +++ b/apps/synt-sykemelding-api/src/main/java/no/nav/testnav/apps/syntsykemeldingapi/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -31,8 +32,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/SecurityConfig.java b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/SecurityConfig.java index 09270479b87..854330b650b 100644 --- a/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/SecurityConfig.java +++ b/apps/synt-vedtakshistorikk-service/src/main/java/no/nav/testnav/apps/syntvedtakshistorikkservice/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -31,8 +32,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/SecurityConfig.java b/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/SecurityConfig.java index 65c349d240f..8f7d5042fbb 100644 --- a/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/SecurityConfig.java +++ b/apps/testnav-ident-pool/src/main/java/no/nav/testnav/identpool/config/SecurityConfig.java @@ -2,6 +2,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -26,8 +27,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/testnorge-tp/src/main/java/no/nav/registre/tp/config/SecurityConfig.java b/apps/testnorge-tp/src/main/java/no/nav/registre/tp/config/SecurityConfig.java index 15df6a173cc..90b9a052e59 100644 --- a/apps/testnorge-tp/src/main/java/no/nav/registre/tp/config/SecurityConfig.java +++ b/apps/testnorge-tp/src/main/java/no/nav/registre/tp/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.http.SessionCreationPolicy; import org.springframework.security.web.SecurityFilterChain; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/SecurityConfig.java b/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/SecurityConfig.java index 04efa45bc88..30d81e6a131 100644 --- a/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/SecurityConfig.java +++ b/apps/tilbakemelding-api/src/main/java/no/nav/registre/testnorge/tilbakemeldingapi/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/SecurityConfig.java b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/SecurityConfig.java index 8b7158389ad..e1dbd8a575e 100644 --- a/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/SecurityConfig.java +++ b/apps/tps-messaging-service/src/main/java/no/nav/testnav/apps/tpsmessagingservice/config/SecurityConfig.java @@ -4,6 +4,7 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; import org.springframework.core.annotation.Order; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -30,8 +31,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/udi-stub/src/main/java/no/nav/udistub/config/SecurityConfig.java b/apps/udi-stub/src/main/java/no/nav/udistub/config/SecurityConfig.java index 1931e1181c7..e72d859f0b7 100644 --- a/apps/udi-stub/src/main/java/no/nav/udistub/config/SecurityConfig.java +++ b/apps/udi-stub/src/main/java/no/nav/udistub/config/SecurityConfig.java @@ -3,6 +3,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -28,8 +29,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/SecurityConfig.java b/apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/SecurityConfig.java index 632c00da6d2..b734fa96cdc 100644 --- a/apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/SecurityConfig.java +++ b/apps/varslinger-service/src/main/java/no/nav/registre/varslingerservice/config/SecurityConfig.java @@ -2,6 +2,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.http.SessionCreationPolicy; @@ -26,8 +27,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti "/error", "/swagger-ui.html" ).permitAll().requestMatchers("/api/**").fullyAuthenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(jwtConfigurer -> { - })); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())); return httpSecurity.build(); } diff --git a/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/SecurityConfig.java b/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/SecurityConfig.java index 7e20ed40d0a..a947440fe39 100644 --- a/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/SecurityConfig.java +++ b/libs/reactive-proxy/src/main/java/no/nav/testnav/libs/reactiveproxy/config/SecurityConfig.java @@ -36,6 +36,7 @@ public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity httpS "/error", "/swagger-ui.html" ).permitAll().anyExchange().authenticated()) - .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())).build(); + .oauth2ResourceServer(oauth2RSConfig -> oauth2RSConfig.jwt(Customizer.withDefaults())) + .build(); } }