From ca350380fbe419d08be4883e6b263b0027bc582a Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Sun, 6 Mar 2022 16:25:37 +0100 Subject: [PATCH] Change local development and ci to quarkus (#2115) --- .github/workflows/cypress.yml | 14 +++------ Dockerfile | 4 +-- .../client_authorization_test.spec.ts | 4 +-- .../integration/client_scopes_test.spec.ts | 4 +-- cypress/integration/clients_saml_test.spec.ts | 2 +- cypress/integration/clients_test.spec.ts | 4 +-- .../identity_providers_oidc_test.spec.ts | 4 +-- .../identity_providers_saml_test.spec.ts | 2 +- cypress/integration/realm_roles_test.spec.ts | 2 +- ...ealm_settings_client_policies_test.spec.ts | 6 ++-- ...ealm_settings_client_profiles_test.spec.ts | 4 +-- .../realm_settings_events_test.spec.ts | 10 +++---- cypress/integration/realm_test.spec.ts | 2 +- cypress/integration/users_test.spec.ts | 2 +- .../pages/admin_console/ListingPage.ts | 4 +-- .../manage/events/AdminEventsTab.ts | 2 +- .../manage/events/UserEventsTab.ts | 2 +- .../realm_settings/RealmSettingsPage.ts | 6 ++-- cypress/support/util/AdminClient.ts | 2 +- import.mjs | 2 +- snowpack.config.mjs | 2 +- src/environment.ts | 6 ++-- src/identity-providers/help.ts | 2 +- start.mjs | 29 ++++++++++--------- 24 files changed, 58 insertions(+), 63 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 456215e913..7b7beba2b1 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -47,19 +47,13 @@ jobs: working-directory: ${{ env.KEYCLOAK_SERVER_PATH }} run: | VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - echo "KEYCLOAK_SERVER_BIN=keycloak-server/distribution/server-dist/target/keycloak-$VERSION/bin" >> $GITHUB_ENV + tar -xvf quarkus/dist/target/keycloak-$VERSION.tar.gz -C quarkus/dist/target/ + echo "KEYCLOAK_SERVER_BIN=keycloak-server/quarkus/dist/target/keycloak-$VERSION/bin" >> $GITHUB_ENV - name: Start Keycloak Server working-directory: ${{ env.KEYCLOAK_SERVER_BIN }} run: | - ./add-user-keycloak.sh --user admin --password admin - ./standalone.sh -Dkeycloak.profile.feature.admin2=enabled -Dkeycloak.profile.feature.declarative_user_profile=enabled & - - - name: Configure Keycloak Server - working-directory: ${{ env.KEYCLOAK_SERVER_BIN }} - run: | - ./kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin --password admin - ./kcadm.sh update realms/master -s "adminTheme=keycloak.v2" + KEYCLOAK_ADMIN=admin KEYCLOAK_ADMIN_PASSWORD=admin ./kc.sh start-dev -Dkeycloak.profile.feature.admin2=enabled -Dkeycloak.profile.feature.declarative_user_profile=enabled & - name: Set up Node uses: actions/setup-node@v2 @@ -75,7 +69,7 @@ jobs: - name: Run Cypress working-directory: ${{ env.ADMIN_UI_PATH }} - run: CYPRESS_BASE_URL=http://localhost:8080/auth/admin/ CYPRESS_KEYCLOAK_SERVER=http://localhost:8080 npm run start:cypress-tests + run: CYPRESS_BASE_URL=http://localhost:8080/admin/ CYPRESS_KEYCLOAK_SERVER=http://localhost:8080 npm run start:cypress-tests - name: Add Cypress videos artifacts uses: actions/upload-artifact@v2 diff --git a/Dockerfile b/Dockerfile index a9f01a031b..340cfe1ef1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ COPY . . RUN mvn -f /app/keycloak-theme/pom.xml install -FROM quay.io/keycloak/keycloak:17.0.0-legacy -COPY --from=builder /app/keycloak-theme/target/classes /opt/jboss/keycloak/themes/keycloak.v2 +FROM quay.io/keycloak/keycloak:17.0.0 +COPY --from=builder /app/keycloak-theme/target/keycloak-admin-ui*.jar /opt/jboss/keycloak/lib/lib/main/ EXPOSE 8080 diff --git a/cypress/integration/client_authorization_test.spec.ts b/cypress/integration/client_authorization_test.spec.ts index c04b63bb29..202e63ca37 100644 --- a/cypress/integration/client_authorization_test.spec.ts +++ b/cypress/integration/client_authorization_test.spec.ts @@ -88,7 +88,7 @@ describe("Client authentication subtab", () => { authenticationTab.goToPolicySubTab(); cy.intercept( "GET", - "/auth/admin/realms/master/clients/*/authz/resource-server/policy/regex/*" + "/admin/realms/master/clients/*/authz/resource-server/policy/regex/*" ).as("get"); authenticationTab .goToCreatePolicy("regex") @@ -117,7 +117,7 @@ describe("Client authentication subtab", () => { authenticationTab.goToPolicySubTab(); cy.intercept( "GET", - "/auth/admin/realms/master/clients/*/authz/resource-server/policy/client/*" + "/admin/realms/master/clients/*/authz/resource-server/policy/client/*" ).as("get"); authenticationTab .goToCreatePolicy("client") diff --git a/cypress/integration/client_scopes_test.spec.ts b/cypress/integration/client_scopes_test.spec.ts index bfe59d76ca..b7d23c2b1c 100644 --- a/cypress/integration/client_scopes_test.spec.ts +++ b/cypress/integration/client_scopes_test.spec.ts @@ -28,6 +28,7 @@ describe("Client Scopes test", () => { "Are you sure you want to delete this client scope"; const notificationMessageDeletionConfirmation = "The client scope has been deleted"; + const clientScopeName = "client-scope-test"; const openIDConnectItemText = "OpenID Connect"; const clientScope = { @@ -324,9 +325,8 @@ describe("Client Scopes test", () => { describe("Scope test", () => { const scopeTab = new RoleMappingTab(); const scopeName = "address"; - it("Assign role", () => { - const role = "offline_access"; + const role = "admin"; listingPage.searchItem(scopeName, false).goToItemDetails(scopeName); scopeTab.goToScopeTab().assignRole().selectRow(role).assign(); masthead.checkNotificationMessage("Role mapping updated"); diff --git a/cypress/integration/clients_saml_test.spec.ts b/cypress/integration/clients_saml_test.spec.ts index 9f4a14752c..d3b3a1d42f 100644 --- a/cypress/integration/clients_saml_test.spec.ts +++ b/cypress/integration/clients_saml_test.spec.ts @@ -93,7 +93,7 @@ describe("Clients SAML tests", () => { it("disable client signature", () => { cy.intercept( - "auth/admin/realms/master/clients/*/certificates/saml.signing" + "admin/realms/master/clients/*/certificates/saml.signing" ).as("load"); cy.findByTestId("clientSignature").click({ force: true }); cy.waitFor("@load"); diff --git a/cypress/integration/clients_test.spec.ts b/cypress/integration/clients_test.spec.ts index a9a08b6778..fb8ada9a7e 100644 --- a/cypress/integration/clients_test.spec.ts +++ b/cypress/integration/clients_test.spec.ts @@ -70,7 +70,7 @@ describe("Clients test", () => { keycloakBefore(); loginPage.logIn(); sidebarPage.goToClients(); - cy.intercept("/auth/admin/realms/master/clients/*").as("fetchClient"); + cy.intercept("/admin/realms/master/clients/*").as("fetchClient"); listingPage.searchItem(clientId).goToItemDetails(clientId); cy.wait("@fetchClient"); clientScopesTab.goToClientScopesTab(); @@ -569,7 +569,7 @@ describe("Clients test", () => { bearerOnly: true, }); sidebarPage.goToClients(); - cy.intercept("/auth/admin/realms/master/clients/*").as("fetchClient"); + cy.intercept("/admin/realms/master/clients/*").as("fetchClient"); listingPage.searchItem(clientId).goToItemDetails(clientId); cy.wait("@fetchClient"); }); diff --git a/cypress/integration/identity_providers_oidc_test.spec.ts b/cypress/integration/identity_providers_oidc_test.spec.ts index 34953879bd..94fab7d996 100644 --- a/cypress/integration/identity_providers_oidc_test.spec.ts +++ b/cypress/integration/identity_providers_oidc_test.spec.ts @@ -22,8 +22,8 @@ describe("OIDC identity provider test", () => { const deleteSuccessMsg = "Provider successfully deleted"; const keycloakServer = Cypress.env("KEYCLOAK_SERVER"); - const discoveryUrl = `${keycloakServer}/auth/realms/master/.well-known/openid-configuration`; - const authorizationUrl = `${keycloakServer}/auth/realms/master/protocol/openid-connect/auth`; + const discoveryUrl = `${keycloakServer}/realms/master/.well-known/openid-configuration`; + const authorizationUrl = `${keycloakServer}/realms/master/protocol/openid-connect/auth`; describe("OIDC Identity provider creation", () => { const identityProviderName = "github"; diff --git a/cypress/integration/identity_providers_saml_test.spec.ts b/cypress/integration/identity_providers_saml_test.spec.ts index e88dd3f86c..b2a2a3d7eb 100644 --- a/cypress/integration/identity_providers_saml_test.spec.ts +++ b/cypress/integration/identity_providers_saml_test.spec.ts @@ -23,7 +23,7 @@ describe("Identity provider test", () => { const deleteSuccessMsg = "Provider successfully deleted"; const keycloakServer = Cypress.env("KEYCLOAK_SERVER"); - const samlDiscoveryUrl = `${keycloakServer}/auth/realms/master/protocol/saml/descriptor`; + const samlDiscoveryUrl = `${keycloakServer}/realms/master/protocol/saml/descriptor`; describe("SAML identity provider creation", () => { const identityProviderName = "github"; diff --git a/cypress/integration/realm_roles_test.spec.ts b/cypress/integration/realm_roles_test.spec.ts index cf9ba4bf94..50d916134f 100644 --- a/cypress/integration/realm_roles_test.spec.ts +++ b/cypress/integration/realm_roles_test.spec.ts @@ -59,7 +59,7 @@ describe("Realm roles test", () => { masthead.checkNotificationMessage("Role created", true); sidebarPage.goToRealmRoles(); - const fetchUrl = "/auth/admin/realms/master/roles?first=0&max=11"; + const fetchUrl = "/admin/realms/master/roles?first=0&max=11"; cy.intercept(fetchUrl).as("fetch"); listingPage.deleteItem(itemId); diff --git a/cypress/integration/realm_settings_client_policies_test.spec.ts b/cypress/integration/realm_settings_client_policies_test.spec.ts index fb24ee64a2..66638d5b24 100644 --- a/cypress/integration/realm_settings_client_policies_test.spec.ts +++ b/cypress/integration/realm_settings_client_policies_test.spec.ts @@ -48,7 +48,7 @@ describe("Realm settings client policies tab tests", () => { }); it("Complete new client form and submit", () => { - const url = `/auth/admin/realms/${realmName}/client-policies/policies`; + const url = `/admin/realms/${realmName}/client-policies/policies`; cy.intercept("PUT", url).as("save"); realmSettingsPage.createNewClientPolicyFromEmptyState( @@ -135,7 +135,7 @@ describe("Realm settings client policies tab tests", () => { }); it("Should not create duplicate client profile", () => { - const url = `/auth/admin/realms/${realmName}/client-policies/policies`; + const url = `admin/realms/${realmName}/client-policies/policies`; cy.intercept("PUT", url).as("save"); realmSettingsPage.createNewClientPolicyFromEmptyState( @@ -172,7 +172,7 @@ describe("Realm settings client policies tab tests", () => { }); it("Check deleting newly created client policy from create view via dropdown", () => { - const url = `/auth/admin/realms/${realmName}/client-policies/policies`; + const url = `admin/realms/${realmName}/client-policies/policies`; cy.intercept("PUT", url).as("save"); realmSettingsPage.createNewClientPolicyFromEmptyState( "Test again", diff --git a/cypress/integration/realm_settings_client_profiles_test.spec.ts b/cypress/integration/realm_settings_client_profiles_test.spec.ts index 7ce1a32bb4..6d44c6fa7e 100644 --- a/cypress/integration/realm_settings_client_profiles_test.spec.ts +++ b/cypress/integration/realm_settings_client_profiles_test.spec.ts @@ -52,7 +52,7 @@ describe("Realm settings client profiles tab tests", () => { }); it("Complete new client form and submit", () => { - const url = `/auth/admin/realms/${realmName}/client-policies/profiles`; + const url = `admin/realms/${realmName}/client-policies/profiles`; cy.intercept("PUT", url).as("save"); realmSettingsPage .createClientProfile(profileName, "Test Description") @@ -78,7 +78,7 @@ describe("Realm settings client profiles tab tests", () => { }); it("Should not create duplicate client profile", () => { - const url = `/auth/admin/realms/${realmName}/client-policies/profiles`; + const url = `admin/realms/${realmName}/client-policies/profiles`; cy.intercept("PUT", url).as("save"); realmSettingsPage .createClientProfile(profileName, "Test Description") diff --git a/cypress/integration/realm_settings_events_test.spec.ts b/cypress/integration/realm_settings_events_test.spec.ts index efae48203a..ffb77e21f4 100644 --- a/cypress/integration/realm_settings_events_test.spec.ts +++ b/cypress/integration/realm_settings_events_test.spec.ts @@ -32,7 +32,7 @@ describe("Realm settings events tab tests", () => { }); const goToDetails = () => { - const keysUrl = `/auth/admin/realms/${realmName}/keys`; + const keysUrl = `/admin/realms/${realmName}/keys`; cy.intercept(keysUrl).as("keysFetch"); cy.findByTestId("rs-keys-tab").click(); @@ -77,7 +77,7 @@ describe("Realm settings events tab tests", () => { }; const goToKeys = () => { - const keysUrl = `/auth/admin/realms/${realmName}/keys`; + const keysUrl = `/admin/realms/${realmName}/keys`; cy.intercept(keysUrl).as("keysFetch"); cy.findByTestId("rs-keys-tab").click(); cy.findByTestId("rs-keys-list-tab").click(); @@ -96,9 +96,7 @@ describe("Realm settings events tab tests", () => { }; it("Enable user events", () => { - cy.intercept("GET", `/auth/admin/realms/${realmName}/events/config`).as( - "load" - ); + cy.intercept("GET", `/admin/realms/${realmName}/events/config`).as("load"); sidebarPage.goToRealmSettings(); cy.findByTestId("rs-realm-events-tab").click(); cy.findByTestId("rs-events-tab").click(); @@ -115,7 +113,7 @@ describe("Realm settings events tab tests", () => { .confirmModal(); masthead.checkNotificationMessage("The user events have been cleared"); const events = ["Client info", "Client info error"]; - cy.intercept("GET", `/auth/admin/realms/${realmName}/events/config`).as( + cy.intercept("GET", `/admin/realms/${realmName}/events/config`).as( "fetchConfig" ); realmSettingsPage.addUserEvents(events).clickAdd(); diff --git a/cypress/integration/realm_test.spec.ts b/cypress/integration/realm_test.spec.ts index f253ea96f7..2389fb8e0f 100644 --- a/cypress/integration/realm_test.spec.ts +++ b/cypress/integration/realm_test.spec.ts @@ -58,7 +58,7 @@ describe("Realms test", () => { sidebarPage.goToCreateRealm(); createRealmPage.fillRealmName(newRealmName).createRealm(); - const fetchUrl = "/auth/admin/realms?briefRepresentation=true"; + const fetchUrl = "/admin/realms?briefRepresentation=true"; cy.intercept(fetchUrl).as("fetch"); masthead.checkNotificationMessage("Realm created"); diff --git a/cypress/integration/users_test.spec.ts b/cypress/integration/users_test.spec.ts index 801f1b3ba7..8d3df7d933 100644 --- a/cypress/integration/users_test.spec.ts +++ b/cypress/integration/users_test.spec.ts @@ -156,7 +156,7 @@ describe("User creation", () => { listingPage.searchItem(itemId).itemExist(itemId); listingPage.goToItemDetails(itemId); - cy.intercept("PUT", `/auth/admin/realms/master/users/*`).as("save-user"); + cy.intercept("PUT", `/admin/realms/master/users/*`).as("save-user"); const attributeKey = "key-multiple"; attributesTab diff --git a/cypress/support/pages/admin_console/ListingPage.ts b/cypress/support/pages/admin_console/ListingPage.ts index 65e58d62d5..2aa73918fa 100644 --- a/cypress/support/pages/admin_console/ListingPage.ts +++ b/cypress/support/pages/admin_console/ListingPage.ts @@ -84,7 +84,7 @@ export default class ListingPage { searchItem(searchValue: string, wait = true) { if (wait) { - const searchUrl = `/auth/admin/realms/master/*${searchValue}*`; + const searchUrl = `/admin/realms/master/*${searchValue}*`; cy.intercept(searchUrl).as("search"); } @@ -289,7 +289,7 @@ export default class ListingPage { } changeTypeToOfSelectedItems(assignedType: FilterAssignedType) { - cy.intercept("/auth/admin/realms/master/client-scopes").as("load"); + cy.intercept("/admin/realms/master/client-scopes").as("load"); cy.get(this.toolbarChangeType).click(); cy.get(this.itemRowSelectItem).contains(assignedType).click(); cy.wait("@load"); diff --git a/cypress/support/pages/admin_console/manage/events/AdminEventsTab.ts b/cypress/support/pages/admin_console/manage/events/AdminEventsTab.ts index ead052730e..0416ae8286 100644 --- a/cypress/support/pages/admin_console/manage/events/AdminEventsTab.ts +++ b/cypress/support/pages/admin_console/manage/events/AdminEventsTab.ts @@ -45,7 +45,7 @@ export default class AdminEventsTab { cy.findByTestId(this.searchAdminEventDrpDwnBtn).click(); cy.findByTestId(this.resourcePathInputFld).type("events/config"); - cy.intercept("/auth/admin/realms/master/admin-events*").as("eventsFetch"); + cy.intercept("/admin/realms/master/admin-events*").as("eventsFetch"); cy.findByTestId(this.searchEventsBtn).click(); cy.wait("@eventsFetch"); diff --git a/cypress/support/pages/admin_console/manage/events/UserEventsTab.ts b/cypress/support/pages/admin_console/manage/events/UserEventsTab.ts index 438ec70ea7..31810cb328 100644 --- a/cypress/support/pages/admin_console/manage/events/UserEventsTab.ts +++ b/cypress/support/pages/admin_console/manage/events/UserEventsTab.ts @@ -43,7 +43,7 @@ export default class UserEventsTab { cy.get(this.eventTypeInputFld).type("LOGOUT"); cy.get(this.eventTypeOption).contains("LOGOUT").click(); - cy.intercept("/auth/admin/realms/master/events*").as("eventsFetch"); + cy.intercept("/admin/realms/master/events*").as("eventsFetch"); cy.findByTestId(this.searchEventsBtn).click(); cy.wait("@eventsFetch"); diff --git a/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts b/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts index 632d263320..bbf0f99aa2 100644 --- a/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts +++ b/cypress/support/pages/admin_console/manage/realm_settings/RealmSettingsPage.ts @@ -311,7 +311,7 @@ export default class RealmSettingsPage { } toggleAddProviderDropdown() { - const keysUrl = `/auth/admin/realms/${this.realmName}/keys`; + const keysUrl = `/admin/realms/${this.realmName}/keys`; cy.intercept(keysUrl).as("keysFetch"); cy.findByTestId(this.addProviderDropdown).click(); @@ -750,7 +750,7 @@ export default class RealmSettingsPage { openProfileDetails(name: string) { cy.intercept( - `/auth/admin/realms/${this.realmName}/client-policies/profiles*` + `/admin/realms/${this.realmName}/client-policies/profiles*` ).as("profilesFetch"); cy.get( 'a[href*="realm-settings/clientPolicies/' + name + '/edit-profile"]' @@ -761,7 +761,7 @@ export default class RealmSettingsPage { editExecutor(availablePeriod?: number) { cy.intercept( - `/auth/admin/realms/${this.realmName}/client-policies/profiles*` + `/admin/realms/${this.realmName}/client-policies/profiles*` ).as("profilesFetch"); cy.get(this.editExecutorBtn).click(); cy.wait("@profilesFetch"); diff --git a/cypress/support/util/AdminClient.ts b/cypress/support/util/AdminClient.ts index 6381b1bbae..7d3c8eb8e4 100644 --- a/cypress/support/util/AdminClient.ts +++ b/cypress/support/util/AdminClient.ts @@ -9,7 +9,7 @@ import { merge } from "lodash-es"; class AdminClient { private readonly client = new KeycloakAdminClient({ - baseUrl: `${Cypress.env("KEYCLOAK_SERVER")}/auth`, + baseUrl: Cypress.env("KEYCLOAK_SERVER"), realmName: "master", }); diff --git a/import.mjs b/import.mjs index b47debb0e0..55d3f32200 100755 --- a/import.mjs +++ b/import.mjs @@ -7,7 +7,7 @@ const consoleClientConfig = JSON.parse( ); const adminClient = new KcAdminClient.default({ - baseUrl: "http://localhost:8180/auth", + baseUrl: "http://localhost:8180", realmName: "master", }); diff --git a/snowpack.config.mjs b/snowpack.config.mjs index 563f5271c1..2d44d7761d 100644 --- a/snowpack.config.mjs +++ b/snowpack.config.mjs @@ -30,7 +30,7 @@ export default { ], routes: [ { - src: "/auth/admin/.*", + src: "/admin/.*", dest: (req, res) => proxy.web(req, res, { hostname: "localhost", diff --git a/src/environment.ts b/src/environment.ts index 147fcc4044..7b352424a4 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -25,9 +25,9 @@ const realm = // The default environment, used during development. const defaultEnvironment: Environment = { loginRealm: realm, - authServerUrl: "http://localhost:8180/auth", - authUrl: "http://localhost:8180/auth", - consoleBaseUrl: "/auth/admin/master/console/", + authServerUrl: "http://localhost:8180", + authUrl: "http://localhost:8180", + consoleBaseUrl: "/admin/master/console/", resourceUrl: ".", masterRealm: "master", resourceVersion: "unknown", diff --git a/src/identity-providers/help.ts b/src/identity-providers/help.ts index cb130b74de..b9093e86b1 100644 --- a/src/identity-providers/help.ts +++ b/src/identity-providers/help.ts @@ -37,7 +37,7 @@ export default { useJwksUrl: "If the switch is on, identity provider public keys will be downloaded from given JWKS URL. This allows great flexibility because new keys will be always re-downloaded again when identity provider generates new keypair. If the switch is off, public key (or certificate) from the Keycloak DB is used, so when the identity provider keypair changes, you always need to import the new key to the Keycloak DB as well.", jwksUrl: - "URL where identity provider keys in JWK format are stored. See JWK specification for more details. If you use external Keycloak identity provider, you can use URL like 'http://broker-keycloak:8180/auth/realms/test/protocol/openid-connect/certs' assuming your brokered Keycloak is running on 'http://broker-keycloak:8180' and its realm is 'test' .", + "URL where identity provider keys in JWK format are stored. See JWK specification for more details. If you use external Keycloak identity provider, you can use URL like 'http://broker-keycloak:8180/realms/test/protocol/openid-connect/certs' assuming your brokered Keycloak is running on 'http://broker-keycloak:8180' and its realm is 'test' .", allowedClockSkew: "Clock skew in seconds that is tolerated when validating identity provider tokens. Default value is zero.", attributeConsumingServiceIndex: diff --git a/start.mjs b/start.mjs index aea9a54cbe..71ffdc2a50 100755 --- a/start.mjs +++ b/start.mjs @@ -58,21 +58,24 @@ async function decompressKeycloak() { } const run = () => { - const addProc = spawn( - path.join(serverPath, "bin", `add-user-keycloak${extension}`), - ["--user", "admin", "--password", "admin"] - ); - - addProc.on("exit", () => { - const proc = spawn(path.join(serverPath, "bin", `standalone${extension}`), [ - "-Djboss.socket.binding.port-offset=100", + const proc = spawn( + path.join(serverPath, "bin", `kc${extension}`), + [ + "start-dev", + "--http-port=8180", "-Dkeycloak.profile.feature.admin2=enabled", "-Dkeycloak.profile.feature.declarative_user_profile=enabled", ...args, - ]); - proc.stdout.on("data", (data) => { - console.log(data.toString()); - }); + ], + { + env: { + KEYCLOAK_ADMIN: "admin", + KEYCLOAK_ADMIN_PASSWORD: "admin", + }, + } + ); + proc.stdout.on("data", (data) => { + console.log(data.toString()); }); }; @@ -110,7 +113,7 @@ if (!fs.existsSync(fileName)) { }); request( - `https://github.com/keycloak/keycloak/releases/download/${version}/keycloak-legacy-${version}.tar.gz`, + `https://github.com/keycloak/keycloak/releases/download/${version}/keycloak-${version}.tar.gz`, file, progressBar );