From 3657268ba54eb250a74d7f86b592e995ed0488c1 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Tue, 21 May 2024 11:01:32 +0200 Subject: Adjust keycloak url after KeycloakX upgrade Issue-ID: PORTALNG-104 Change-Id: Ia58100883bb1d23c2f61d3f8d7ce3bfc37358135 Signed-off-by: Fiete Ostkamp --- app/src/main/resources/application-local.yml | 2 +- app/src/main/resources/application.yml | 2 +- app/src/test/java/org/onap/portalng/history/BaseIntegrationTest.java | 4 ++-- app/src/test/java/org/onap/portalng/history/TokenGenerator.java | 2 +- app/src/test/resources/application.yml | 2 +- development/.env | 2 +- development/request.http | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/src/main/resources/application-local.yml b/app/src/main/resources/application-local.yml index fcb5c19..bf50432 100644 --- a/app/src/main/resources/application-local.yml +++ b/app/src/main/resources/application-local.yml @@ -11,7 +11,7 @@ spring: oauth2: resourceserver: jwt: - jwk-set-uri: http://localhost:8080/auth/realms/ONAP/protocol/openid-connect/certs #Keycloak Endpoint + jwk-set-uri: http://localhost:8080/realms/ONAP/protocol/openid-connect/certs #Keycloak Endpoint data: mongodb: database: history diff --git a/app/src/main/resources/application.yml b/app/src/main/resources/application.yml index 15e8422..93da259 100644 --- a/app/src/main/resources/application.yml +++ b/app/src/main/resources/application.yml @@ -13,7 +13,7 @@ spring: oauth2: resourceserver: jwt: - jwk-set-uri: ${KEYCLOAK_URL}/auth/realms/${KEYCLOAK_REALM}/protocol/openid-connect/certs #Keycloak Endpoint + jwk-set-uri: ${KEYCLOAK_URL}/realms/${KEYCLOAK_REALM}/protocol/openid-connect/certs #Keycloak Endpoint data: mongodb: database: ${MONGO_DATABASE} diff --git a/app/src/test/java/org/onap/portalng/history/BaseIntegrationTest.java b/app/src/test/java/org/onap/portalng/history/BaseIntegrationTest.java index ec682dd..bfb1ada 100644 --- a/app/src/test/java/org/onap/portalng/history/BaseIntegrationTest.java +++ b/app/src/test/java/org/onap/portalng/history/BaseIntegrationTest.java @@ -78,7 +78,7 @@ public abstract class BaseIntegrationTest { WireMock.stubFor( WireMock.get( WireMock.urlMatching( - String.format("/auth/realms/%s/protocol/openid-connect/certs", realm))) + String.format("/realms/%s/protocol/openid-connect/certs", realm))) .willReturn( WireMock.aResponse() .withHeader("Content-Type", JWKSet.MIME_TYPE) @@ -90,7 +90,7 @@ public abstract class BaseIntegrationTest { WireMock.stubFor( WireMock.post( WireMock.urlMatching( - String.format("/auth/realms/%s/protocol/openid-connect/token", realm))) + String.format("/realms/%s/protocol/openid-connect/token", realm))) .withBasicAuth("test", "test") .withRequestBody(WireMock.containing("grant_type=client_credentials")) .willReturn( diff --git a/app/src/test/java/org/onap/portalng/history/TokenGenerator.java b/app/src/test/java/org/onap/portalng/history/TokenGenerator.java index 1887682..74fbf0c 100644 --- a/app/src/test/java/org/onap/portalng/history/TokenGenerator.java +++ b/app/src/test/java/org/onap/portalng/history/TokenGenerator.java @@ -123,7 +123,7 @@ public class TokenGenerator { @Builder.Default private final List roles = Collections.emptyList(); public String issuer() { - return String.format("http://localhost:%d/auth/realms/%s", port, realm); + return String.format("http://localhost:%d/realms/%s", port, realm); } } } diff --git a/app/src/test/resources/application.yml b/app/src/test/resources/application.yml index b163059..3fef61a 100644 --- a/app/src/test/resources/application.yml +++ b/app/src/test/resources/application.yml @@ -11,7 +11,7 @@ spring: oauth2: resourceserver: jwt: - jwk-set-uri: http://localhost:${wiremock.server.port}/auth/realms/ONAP/protocol/openid-connect/certs #Keycloak Endpoint + jwk-set-uri: http://localhost:${wiremock.server.port}/realms/ONAP/protocol/openid-connect/certs #Keycloak Endpoint de: flapdoodle: diff --git a/development/.env b/development/.env index ff65652..147c965 100644 --- a/development/.env +++ b/development/.env @@ -1,5 +1,5 @@ KEYCLOAK_IMAGE=quay.io/keycloak/keycloak -KEYCLOAK_VERSION=18.0.2-legacy +KEYCLOAK_VERSION=22.0.4 KEYCLOAK_USER=admin KEYCLOAK_PASSWORD=password KEYCLOAK_DB=keycloak diff --git a/development/request.http b/development/request.http index 72bbb79..b99bc43 100644 --- a/development/request.http +++ b/development/request.http @@ -1,5 +1,5 @@ -POST http://localhost:8080/auth/realms/ONAP/protocol/openid-connect/token +POST http://localhost:8080/realms/ONAP/protocol/openid-connect/token Content-Type: application/x-www-form-urlencoded client_id=portal-app&client_secret=&scope=openid&grant_type=password&username=onap-admin&password=password @@ -10,7 +10,7 @@ client_id=portal-app&client_secret=&scope=openid&grant_type=password&username=on ### -GET http://localhost:8080/auth/realms/ONAP/protocol/openid-connect/userinfo +GET http://localhost:8080/realms/ONAP/protocol/openid-connect/userinfo Authorization: Bearer {{access_token}} X-Auth-Identity: Bearer {{id_token}} -- cgit 1.2.3-korg