From a6ab41b3aea58466cb9a4d653e724f7bf9a39c8e Mon Sep 17 00:00:00 2001 From: Oliver Schmid Date: Mon, 7 Mar 2022 13:35:58 +0100 Subject: [PATCH] fix oauth dependency and circular reference --- service/pom.xml | 6 ------ .../java/eu/ebrains/kg/search/configuration/Config.java | 9 +++++++-- .../eu/ebrains/kg/search/configuration/Keycloak.java | 5 ----- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/service/pom.xml b/service/pom.xml index 9471d8756..0ea91457a 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -69,12 +69,6 @@ ehcache 3.7.1 - - com.nimbusds - oauth2-oidc-sdk - 8.19 - runtime - commons-io commons-io diff --git a/service/src/main/java/eu/ebrains/kg/search/configuration/Config.java b/service/src/main/java/eu/ebrains/kg/search/configuration/Config.java index 78a8f6801..a5b6a7915 100644 --- a/service/src/main/java/eu/ebrains/kg/search/configuration/Config.java +++ b/service/src/main/java/eu/ebrains/kg/search/configuration/Config.java @@ -31,8 +31,7 @@ import io.swagger.v3.oas.models.security.OAuthFlows; import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.keycloak.adapters.springboot.KeycloakSpringBootConfigResolver; import org.springdoc.core.GroupedOpenApi; import org.springframework.beans.factory.annotation.Value; import org.springframework.cache.annotation.EnableCaching; @@ -78,4 +77,10 @@ public OpenAPI customOpenAPI(@Value("${eu.ebrains.kg.login.endpoint}") String lo .security(Collections.singletonList(userWithoutClientReq)); } + @Bean + public KeycloakSpringBootConfigResolver keycloakConfigResolver() { + return new KeycloakSpringBootConfigResolver(); + } + + } diff --git a/service/src/main/java/eu/ebrains/kg/search/configuration/Keycloak.java b/service/src/main/java/eu/ebrains/kg/search/configuration/Keycloak.java index 63a2953d9..8da832ff9 100644 --- a/service/src/main/java/eu/ebrains/kg/search/configuration/Keycloak.java +++ b/service/src/main/java/eu/ebrains/kg/search/configuration/Keycloak.java @@ -75,9 +75,4 @@ protected SessionAuthenticationStrategy sessionAuthenticationStrategy() { return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl()); } - @Bean - public KeycloakSpringBootConfigResolver keycloakConfigResolver() { - return new KeycloakSpringBootConfigResolver(); - } - }