Skip to content

Commit

Permalink
Adjust keycloak url after KeycloakX upgrade
Browse files Browse the repository at this point in the history
Issue-ID: PORTALNG-104
Change-Id: I181b78dfc333efb968e6281a80bc4c6faa1040f6
Signed-off-by: Fiete Ostkamp <[email protected]>
  • Loading branch information
Fiete Ostkamp authored and Fiete Ostkamp committed May 21, 2024
1 parent 3629e5e commit 541945e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: portal_preferences
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void mockAuth() {
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)
Expand All @@ -80,7 +80,7 @@ public void mockAuth() {
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static class TokenGeneratorConfig {
@Builder.Default private final List<String> 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);
}
}
}
2 changes: 1 addition & 1 deletion app/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,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

preferences:
realm: ONAP
Expand Down
2 changes: 1 addition & 1 deletion development/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
KEYCLOAK_IMAGE=quay.io/keycloak/keycloak
KEYCLOAK_VERSION=18.0.2-legacy
KEYCLOAK_VERSION=22.04
KEYCLOAK_USER=admin
KEYCLOAK_PASSWORD=password
KEYCLOAK_DB=keycloak
Expand Down
2 changes: 1 addition & 1 deletion development/request.http
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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
Expand Down

0 comments on commit 541945e

Please sign in to comment.