ef-keycloak-connect 1.8.4-patch → 1.8.4-patch-2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -4277,7 +4277,7 @@ class KeycloakService extends Keycloak {
|
|
|
4277
4277
|
|
|
4278
4278
|
// !-------------- Multitenancy -----------------!
|
|
4279
4279
|
|
|
4280
|
-
async createRealmAsTenant( tenantName, realmDataString, authzConfigDataString ) {
|
|
4280
|
+
async createRealmAsTenant( tenantName, realmDataString, authzConfigDataString, keycloakConfig ) {
|
|
4281
4281
|
|
|
4282
4282
|
return new Promise( async ( resolve, reject ) => {
|
|
4283
4283
|
|
|
@@ -4323,7 +4323,7 @@ class KeycloakService extends Keycloak {
|
|
|
4323
4323
|
let mainMessage = "";
|
|
4324
4324
|
|
|
4325
4325
|
let accessToken;
|
|
4326
|
-
let URL =
|
|
4326
|
+
let URL = keycloakConfig[ "auth-server-url" ] + "realms/master/protocol/openid-connect/token";
|
|
4327
4327
|
|
|
4328
4328
|
let config = {
|
|
4329
4329
|
method: "post",
|
|
@@ -4334,8 +4334,8 @@ class KeycloakService extends Keycloak {
|
|
|
4334
4334
|
data: {
|
|
4335
4335
|
client_id: "admin-cli",
|
|
4336
4336
|
grant_type: "password",
|
|
4337
|
-
username:
|
|
4338
|
-
password:
|
|
4337
|
+
username: keycloakConfig[ "MASTER_USERNAME" ],
|
|
4338
|
+
password: keycloakConfig[ "MASTER_PASSWORD" ]
|
|
4339
4339
|
},
|
|
4340
4340
|
};
|
|
4341
4341
|
|
|
@@ -4345,7 +4345,7 @@ class KeycloakService extends Keycloak {
|
|
|
4345
4345
|
|
|
4346
4346
|
accessToken = adminAccessToken.data.access_token;
|
|
4347
4347
|
|
|
4348
|
-
let createRealmUrl =
|
|
4348
|
+
let createRealmUrl = keycloakConfig[ "auth-server-url" ] + 'admin/realms';
|
|
4349
4349
|
|
|
4350
4350
|
// 1. Read the realm configuration JSON file
|
|
4351
4351
|
console.log( `Reading realm configuration from provided realm data.` );
|
|
@@ -4365,8 +4365,6 @@ class KeycloakService extends Keycloak {
|
|
|
4365
4365
|
data: realmData
|
|
4366
4366
|
};
|
|
4367
4367
|
|
|
4368
|
-
console.log( realmData );
|
|
4369
|
-
|
|
4370
4368
|
try {
|
|
4371
4369
|
|
|
4372
4370
|
let realmCreation = await requestController.httpRequest( config1, false );
|
|
@@ -4392,7 +4390,7 @@ class KeycloakService extends Keycloak {
|
|
|
4392
4390
|
|
|
4393
4391
|
// 4. Get the internal UUID of the target client
|
|
4394
4392
|
console.log( `Fetching UUID for client '${targetClientIdForAuthz}' in realm '${tenantName}'...` );
|
|
4395
|
-
const getClientUrl = `${
|
|
4393
|
+
const getClientUrl = `${keycloakConfig[ "auth-server-url" ]}admin/realms/${tenantName}/clients`;
|
|
4396
4394
|
|
|
4397
4395
|
let config2 = {
|
|
4398
4396
|
|
|
@@ -4465,7 +4463,7 @@ class KeycloakService extends Keycloak {
|
|
|
4465
4463
|
} );
|
|
4466
4464
|
}
|
|
4467
4465
|
|
|
4468
|
-
const importAuthzUrl = `${
|
|
4466
|
+
const importAuthzUrl = `${keycloakConfig[ "auth-server-url" ]}admin/realms/${tenantName}/clients/${clientUuid}/authz/resource-server/import`;
|
|
4469
4467
|
|
|
4470
4468
|
let config3 = {
|
|
4471
4469
|
|