From ac9bc52de622b46ccca10ed79e574d51fcd97684 Mon Sep 17 00:00:00 2001
From: Baptiste Toulemonde <toulemonde@cines.fr>
Date: Wed, 15 Dec 2021 18:06:13 +0100
Subject: [PATCH] fix controller isuue k8s

---
 .../config/SmartHarvesterSecurityConfiguration.java          | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/smartharvester/config/SmartHarvesterSecurityConfiguration.java b/src/main/java/com/smartharvester/config/SmartHarvesterSecurityConfiguration.java
index 8501f34..dd6be10 100644
--- a/src/main/java/com/smartharvester/config/SmartHarvesterSecurityConfiguration.java
+++ b/src/main/java/com/smartharvester/config/SmartHarvesterSecurityConfiguration.java
@@ -64,10 +64,11 @@ public class SmartHarvesterSecurityConfiguration extends WebSecurityConfigurerAd
 
 	@Override
 	protected void configure(HttpSecurity http) throws Exception {
-		http.csrf().disable().cors().and().authorizeRequests().antMatchers("/oauth2/**", "/login**", "/smart-harvester/**", "/harvester/api/catalogs","/resources/**", "/public/error/css/**", "/smart-docs/**").permitAll()
+		http.csrf().disable().cors().and().authorizeRequests().antMatchers("/harvester/oauth2/**","/oauth2/**", "/login**", "/smart-harvester/**", "/harvester/api/catalogs","/resources/**", "/public/error/css/**", "/smart-docs/**").permitAll()
 		.anyRequest().authenticated()
 		.and()
-		.oauth2Login().authorizationEndpoint().authorizationRequestRepository(new InMemoryRequestRepository())
+		.oauth2Login().authorizationEndpoint().baseUri("/harvester/oauth2/authorization")
+		.authorizationRequestRepository(new InMemoryRequestRepository())
 		.and()
 		.successHandler(this::successHandler)
 		.and()
-- 
GitLab