nextemos 5.2.7 → 5.2.9
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.
|
@@ -52,5 +52,7 @@ catch (error) {
|
|
|
52
52
|
}
|
|
53
53
|
// Merge with default config to ensure all required fields exist
|
|
54
54
|
const NEXTEMOS_CONFIG = Object.assign(Object.assign({}, exports.defaultConfig), loadedConfig);
|
|
55
|
-
|
|
55
|
+
if (process.env.KEYCLOAK_CLIENT_SECRET) {
|
|
56
|
+
NEXTEMOS_CONFIG.KEYCLOAK.CLIENT_SECRET = process.env.KEYCLOAK_CLIENT_SECRET;
|
|
57
|
+
}
|
|
56
58
|
exports.default = NEXTEMOS_CONFIG;
|
|
@@ -6,3 +6,10 @@ export interface IKeycloakTokenResponse {
|
|
|
6
6
|
"not-before-policy": number;
|
|
7
7
|
scope: string;
|
|
8
8
|
}
|
|
9
|
+
export interface IKeycloakConfigurationsResponse {
|
|
10
|
+
realm: string;
|
|
11
|
+
public_key: string;
|
|
12
|
+
token_service: string;
|
|
13
|
+
account_service: string;
|
|
14
|
+
tokens_not_before: number;
|
|
15
|
+
}
|
|
@@ -41,4 +41,13 @@ exports.KeycloakService = {
|
|
|
41
41
|
}, body: encodedBody }));
|
|
42
42
|
});
|
|
43
43
|
},
|
|
44
|
+
GetConfigurations: function () {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
return yield (0, __1.fetchRequest)().get(`${this.ServiceUrl}/realms/${KEYCLOAK.REALM}`, {
|
|
47
|
+
headers: {
|
|
48
|
+
"Content-Type": "application/json",
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
},
|
|
44
53
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IKeycloakTokenResponse } from "../../";
|
|
1
|
+
import { IKeycloakConfigurationsResponse, IKeycloakTokenResponse } from "../../";
|
|
2
2
|
import { IApiResponse, IRequestInit } from "../..";
|
|
3
3
|
export interface IKeycloakTokenRequest {
|
|
4
4
|
client_id: string;
|
|
@@ -9,4 +9,5 @@ export interface IKeycloakTokenRequest {
|
|
|
9
9
|
export interface IKeycloakService {
|
|
10
10
|
ServiceUrl: string;
|
|
11
11
|
Token: (options?: IRequestInit) => Promise<IApiResponse<IKeycloakTokenResponse>>;
|
|
12
|
+
GetConfigurations: () => Promise<IApiResponse<IKeycloakConfigurationsResponse>>;
|
|
12
13
|
}
|