@open-pioneer/authentication-keycloak 2.3.0 → 2.4.0-dev.20241120085048
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/CHANGELOG.md +54 -0
- package/KeycloakAuthPlugin.d.ts +2 -3
- package/KeycloakAuthPlugin.js +3 -11
- package/KeycloakAuthPlugin.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# @open-pioneer/authentication-keycloak
|
|
2
2
|
|
|
3
|
+
## 2.4.0-dev.20241120085048
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1ce5f11: Replace change events for auth state with signals from Reactivity API
|
|
8
|
+
|
|
9
|
+
Example: watch for updates of the auth state
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
const myAuthService = ...
|
|
13
|
+
watch(
|
|
14
|
+
() => [myAuthService.getAuthState()],
|
|
15
|
+
([state]) => {
|
|
16
|
+
console.log(state);
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
immediate: true
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The Auth Service forwards the auth state from the underlying AuthPlugin.
|
|
25
|
+
Therefore, the plugin implementation must use reactive signals when its auth state changes in order to signal changes to the service.
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
class DummyPlugin implements AuthPlugin {
|
|
29
|
+
#state = reactive<AuthState>({
|
|
30
|
+
kind: "not-authenticated"
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
getAuthState(): AuthState {
|
|
34
|
+
return this.#state.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
$setAuthState(newState: AuthState) {
|
|
38
|
+
this.#state.value = newState;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- 1b63ebe: Update dependencies
|
|
46
|
+
- Updated dependencies [1ce5f11]
|
|
47
|
+
- Updated dependencies [1b63ebe]
|
|
48
|
+
- Updated dependencies [e3802fb]
|
|
49
|
+
- Updated dependencies [e4ba048]
|
|
50
|
+
- Updated dependencies [ac39468]
|
|
51
|
+
- Updated dependencies [e3802fb]
|
|
52
|
+
- @open-pioneer/authentication@2.4.0-dev.20241120085048
|
|
53
|
+
- @open-pioneer/core@2.4.0-dev.20241120085048
|
|
54
|
+
- @open-pioneer/notifier@2.4.0-dev.20241120085048
|
|
55
|
+
- @open-pioneer/runtime@2.4.0-dev.20241120085048
|
|
56
|
+
|
|
3
57
|
## 2.3.0
|
|
4
58
|
|
|
5
59
|
### Minor Changes
|
package/KeycloakAuthPlugin.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { AuthPlugin,
|
|
2
|
-
import { EventEmitter } from "@open-pioneer/core";
|
|
1
|
+
import { AuthPlugin, AuthState, LoginBehavior } from "@open-pioneer/authentication";
|
|
3
2
|
import { NotificationService } from "@open-pioneer/notifier";
|
|
4
3
|
import { Service, ServiceOptions, type DECLARE_SERVICE_INTERFACE } from "@open-pioneer/runtime";
|
|
5
4
|
import { KeycloakOptions, KeycloakProperties } from "./api";
|
|
6
5
|
interface References {
|
|
7
6
|
notifier: NotificationService;
|
|
8
7
|
}
|
|
9
|
-
export declare class KeycloakAuthPlugin
|
|
8
|
+
export declare class KeycloakAuthPlugin implements Service, AuthPlugin {
|
|
10
9
|
#private;
|
|
11
10
|
[DECLARE_SERVICE_INTERFACE]: "authentication-keycloak.KeycloakAuthPlugin";
|
|
12
11
|
constructor(options: ServiceOptions<References>);
|
package/KeycloakAuthPlugin.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { reactive
|
|
2
|
-
import { createLogger,
|
|
1
|
+
import { reactive } from '@conterra/reactivity-core';
|
|
2
|
+
import { createLogger, destroyResource } from '@open-pioneer/core';
|
|
3
3
|
import Keycloak from 'keycloak-js';
|
|
4
4
|
|
|
5
5
|
const LOG = createLogger("authentication-keycloak:KeycloakAuthPlugin");
|
|
6
|
-
class KeycloakAuthPlugin
|
|
6
|
+
class KeycloakAuthPlugin {
|
|
7
7
|
#notifier;
|
|
8
8
|
#intl;
|
|
9
9
|
#keycloakOptions;
|
|
@@ -17,17 +17,10 @@ class KeycloakAuthPlugin extends EventEmitter {
|
|
|
17
17
|
kind: "pending"
|
|
18
18
|
});
|
|
19
19
|
constructor(options) {
|
|
20
|
-
super();
|
|
21
20
|
this.#notifier = options.references.notifier;
|
|
22
21
|
this.#intl = options.intl;
|
|
23
22
|
this.#logoutOptions = { redirectUri: void 0 };
|
|
24
23
|
this.#loginOptions = { redirectUri: void 0 };
|
|
25
|
-
this.#watcher = watch(
|
|
26
|
-
() => [this.#state.value],
|
|
27
|
-
() => {
|
|
28
|
-
this.emit("changed");
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
24
|
try {
|
|
32
25
|
this.#keycloakOptions = getKeycloakConfig(options.properties);
|
|
33
26
|
} catch (e) {
|
|
@@ -123,7 +116,6 @@ class KeycloakAuthPlugin extends EventEmitter {
|
|
|
123
116
|
this.#updateState({
|
|
124
117
|
kind: "not-authenticated"
|
|
125
118
|
});
|
|
126
|
-
this.emit("changed");
|
|
127
119
|
this.destroy();
|
|
128
120
|
});
|
|
129
121
|
}, interval);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeycloakAuthPlugin.js","sources":["KeycloakAuthPlugin.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { reactive, watch } from \"@conterra/reactivity-core\";\nimport {\n AuthPlugin,\n AuthPluginEvents,\n AuthState,\n LoginBehavior\n} from \"@open-pioneer/authentication\";\nimport { EventEmitter, Resource, createLogger, destroyResource } from \"@open-pioneer/core\";\nimport { NotificationService } from \"@open-pioneer/notifier\";\nimport {\n PackageIntl,\n Service,\n ServiceOptions,\n type DECLARE_SERVICE_INTERFACE\n} from \"@open-pioneer/runtime\";\nimport Keycloak, {\n type KeycloakConfig,\n type KeycloakInitOptions,\n type KeycloakLoginOptions,\n type KeycloakLogoutOptions\n} from \"keycloak-js\";\nimport { KeycloakOptions, KeycloakProperties, RefreshOptions } from \"./api\";\n\nconst LOG = createLogger(\"authentication-keycloak:KeycloakAuthPlugin\");\n\ninterface References {\n notifier: NotificationService;\n}\n\nexport class KeycloakAuthPlugin\n extends EventEmitter<AuthPluginEvents>\n implements Service, AuthPlugin\n{\n declare [DECLARE_SERVICE_INTERFACE]: \"authentication-keycloak.KeycloakAuthPlugin\";\n\n #notifier: NotificationService;\n #intl: PackageIntl;\n #keycloakOptions: KeycloakOptions;\n #keycloak: Keycloak;\n #logoutOptions: KeycloakLogoutOptions;\n #loginOptions: KeycloakLoginOptions;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n #timerId: any;\n #watcher: Resource | undefined;\n\n #state = reactive<AuthState>({\n kind: \"pending\"\n });\n\n constructor(options: ServiceOptions<References>) {\n super();\n this.#notifier = options.references.notifier;\n this.#intl = options.intl;\n this.#logoutOptions = { redirectUri: undefined };\n this.#loginOptions = { redirectUri: undefined };\n\n // Backwards compatibility: emit \"changed\" event when the state changes\n this.#watcher = watch(\n () => [this.#state.value],\n () => {\n this.emit(\"changed\");\n }\n );\n\n try {\n this.#keycloakOptions = getKeycloakConfig(options.properties);\n } catch (e) {\n throw new Error(\"Invalid keycloak configuration\", { cause: e });\n }\n\n try {\n this.#keycloak = new Keycloak(this.#keycloakOptions.keycloakConfig);\n } catch (e) {\n throw new Error(\"Failed to construct keycloak instance\", { cause: e });\n }\n this.#init().catch((e) => {\n this.#updateState({\n kind: \"error\",\n error: e\n });\n this.#notifier.notify({\n level: \"error\",\n title: this.#intl.formatMessage({\n id: \"loginFailed.title\"\n }),\n message: this.#intl.formatMessage({\n id: \"loginFailed.message\"\n })\n });\n\n LOG.error(\"Failed to check if user is authenticated\", e);\n });\n }\n\n destroy() {\n clearInterval(this.#timerId);\n this.#watcher = destroyResource(this.#watcher);\n this.#timerId = undefined;\n }\n\n getAuthState(): AuthState {\n return this.#state.value;\n }\n\n getLoginBehavior(): LoginBehavior {\n const doLogin = () => {\n LOG.debug(\"Login with options\", this.#loginOptions);\n this.#keycloak.login(this.#loginOptions);\n };\n return {\n kind: \"effect\",\n login: doLogin\n };\n }\n\n logout() {\n LOG.debug(\"Logout with options\", this.#logoutOptions);\n this.#keycloak.logout(this.#logoutOptions);\n }\n\n async #init() {\n const keycloakOptions = this.#keycloakOptions;\n const initOptions = this.#keycloakOptions.keycloakInitOptions;\n const refreshOptions = keycloakOptions.refreshOptions;\n\n let isAuthenticated: boolean;\n try {\n isAuthenticated = await this.#keycloak.init(initOptions);\n } catch (e) {\n // Note: keycloak.init() can also throw an exception, in addition to a rejected promise.\n // It may also just throw a string..\n const error = typeof e === \"string\" ? new Error(e) : e;\n throw new Error(\"Failed to initialize keycloak session\", { cause: error });\n }\n\n if (isAuthenticated) {\n this.#updateState({\n kind: \"authenticated\",\n sessionInfo: {\n userId: this.#keycloak.subject ? this.#keycloak.subject : \"undefined\",\n userName: this.#keycloak.idTokenParsed?.preferred_username,\n attributes: {\n keycloak: this.#keycloak,\n familyName: this.#keycloak.idTokenParsed?.family_name,\n givenName: this.#keycloak.idTokenParsed?.given_name,\n userName: this.#keycloak.idTokenParsed?.preferred_username\n }\n }\n });\n\n LOG.debug(`User ${this.#keycloak.subject} is authenticated`);\n\n if (refreshOptions.autoRefresh) {\n LOG.debug(\"Starting auto-refresh\", refreshOptions);\n this.__refresh(refreshOptions.interval, refreshOptions.timeLeft);\n }\n } else {\n this.#updateState({\n kind: \"not-authenticated\"\n });\n LOG.debug(\"User is not authenticated\");\n }\n }\n\n // Mocked in test\n private __refresh(interval: number, timeLeft: number) {\n clearInterval(this.#timerId);\n this.#timerId = setInterval(() => {\n this.#keycloak.updateToken(timeLeft).catch((e) => {\n LOG.error(\"Failed to refresh token\", e);\n this.#updateState({\n kind: \"not-authenticated\"\n });\n this.emit(\"changed\");\n this.destroy();\n });\n }, interval);\n }\n\n #updateState(newState: AuthState) {\n this.#state.value = newState;\n }\n}\n\nconst DEFAULT_AUTO_REFRESH_OPT = {\n autoRefresh: true,\n interval: 6000,\n timeLeft: 70\n};\n\nconst DEFAULT_INIT_OPT = {\n onLoad: \"check-sso\",\n pkceMethod: \"S256\"\n};\n\nexport function getKeycloakConfig(properties: Partial<KeycloakProperties>): KeycloakOptions {\n const { keycloakOptions } = properties;\n\n const { refreshOptions, keycloakInitOptions, keycloakConfig } = keycloakOptions!;\n\n return {\n refreshOptions: { ...getRefreshOpt(refreshOptions) },\n keycloakInitOptions: { ...getInitOpt(keycloakInitOptions) },\n keycloakConfig: { ...getConfigOpt(keycloakConfig) }\n };\n}\n\nfunction getRefreshOpt(autoRefreshOptions: RefreshOptions | undefined): RefreshOptions {\n if (!autoRefreshOptions || isObjectEmpty(autoRefreshOptions)) {\n LOG.warn(\n `The autorefresh options of the Keycloak configuration should be set to ensure automatic refreshes at specified intervals.` +\n ` Defaulting to '${DEFAULT_AUTO_REFRESH_OPT}'.`\n );\n return Object.assign({}, { ...DEFAULT_AUTO_REFRESH_OPT });\n }\n return autoRefreshOptions;\n}\n\nfunction getInitOpt(keycloakInitOptions: KeycloakInitOptions | undefined): KeycloakInitOptions {\n if (!keycloakInitOptions || isObjectEmpty(keycloakInitOptions)) {\n LOG.warn(\n `The Keycloak init options of the keycloak configuration should be set.` +\n ` Defaulting to '${DEFAULT_INIT_OPT}'.`\n );\n return Object.assign({}, { ...DEFAULT_INIT_OPT }) as KeycloakInitOptions;\n }\n return keycloakInitOptions;\n}\n\nfunction getConfigOpt(keycloakConfig: KeycloakConfig | undefined): KeycloakConfig {\n if (!keycloakConfig || isObjectEmpty(keycloakConfig)) {\n throw new Error(\n `KeycloakConfig not found: The Keycloak configuration options are required by the plugin to perform login and logout operations`\n );\n }\n return keycloakConfig;\n}\n\nconst isObjectEmpty = (objectName: unknown) => {\n return objectName && Object.keys(objectName).length === 0 && objectName.constructor === Object;\n};\n"],"names":[],"mappings":";;;;AAyBA,MAAM,GAAA,GAAM,aAAa,4CAA4C,CAAA,CAAA;AAM9D,MAAM,2BACD,YAEZ,CAAA;AAAA,EAGI,SAAA,CAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA,gBAAA,CAAA;AAAA,EACA,SAAA,CAAA;AAAA,EACA,cAAA,CAAA;AAAA,EACA,aAAA,CAAA;AAAA;AAAA,EAEA,QAAA,CAAA;AAAA,EACA,QAAA,CAAA;AAAA,EAEA,SAAS,QAAoB,CAAA;AAAA,IACzB,IAAM,EAAA,SAAA;AAAA,GACT,CAAA,CAAA;AAAA,EAED,YAAY,OAAqC,EAAA;AAC7C,IAAM,KAAA,EAAA,CAAA;AACN,IAAK,IAAA,CAAA,SAAA,GAAY,QAAQ,UAAW,CAAA,QAAA,CAAA;AACpC,IAAA,IAAA,CAAK,QAAQ,OAAQ,CAAA,IAAA,CAAA;AACrB,IAAK,IAAA,CAAA,cAAA,GAAiB,EAAE,WAAA,EAAa,KAAU,CAAA,EAAA,CAAA;AAC/C,IAAK,IAAA,CAAA,aAAA,GAAgB,EAAE,WAAA,EAAa,KAAU,CAAA,EAAA,CAAA;AAG9C,IAAA,IAAA,CAAK,QAAW,GAAA,KAAA;AAAA,MACZ,MAAM,CAAC,IAAK,CAAA,MAAA,CAAO,KAAK,CAAA;AAAA,MACxB,MAAM;AACF,QAAA,IAAA,CAAK,KAAK,SAAS,CAAA,CAAA;AAAA,OACvB;AAAA,KACJ,CAAA;AAEA,IAAI,IAAA;AACA,MAAK,IAAA,CAAA,gBAAA,GAAmB,iBAAkB,CAAA,OAAA,CAAQ,UAAU,CAAA,CAAA;AAAA,aACvD,CAAG,EAAA;AACR,MAAA,MAAM,IAAI,KAAM,CAAA,gCAAA,EAAkC,EAAE,KAAA,EAAO,GAAG,CAAA,CAA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D;AACA,EAAO,OAAA,kBAAA,CAAA;AACX,CAAA;AAEA,SAAS,WAAW,mBAA2E,EAAA;AAC3F,EAAA,IAAI,CAAC,mBAAA,IAAuB,aAAc,CAAA,mBAAmB,CAAG,EAAA;AAC5D,IAAI,GAAA,CAAA,IAAA;AAAA,MACA,yFACuB,gBAAgB,CAAA,EAAA,CAAA;AAAA,KAC3C,CAAA;AACA,IAAA,OAAO,OAAO,MAAO,CAAA,IAAI,EAAE,GAAG,kBAAkB,CAAA,CAAA;AAAA,GACpD;AACA,EAAO,OAAA,mBAAA,CAAA;AACX,CAAA;AAEA,SAAS,aAAa,cAA4D,EAAA;AAC9E,EAAA,IAAI,CAAC,cAAA,IAAkB,aAAc,CAAA,cAAc,CAAG,EAAA;AAClD,IAAA,MAAM,IAAI,KAAA;AAAA,MACN,CAAA,8HAAA,CAAA;AAAA,KACJ,CAAA;AAAA,GACJ;AACA,EAAO,OAAA,cAAA,CAAA;AACX,CAAA;AAEA,MAAM,aAAA,GAAgB,CAAC,UAAwB,KAAA;AAC3C,EAAO,OAAA,UAAA,IAAc,OAAO,IAAK,CAAA,UAAU,EAAE,MAAW,KAAA,CAAA,IAAK,WAAW,WAAgB,KAAA,MAAA,CAAA;AAC5F,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"KeycloakAuthPlugin.js","sources":["KeycloakAuthPlugin.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { reactive } from \"@conterra/reactivity-core\";\nimport { AuthPlugin, AuthState, LoginBehavior } from \"@open-pioneer/authentication\";\nimport { Resource, createLogger, destroyResource } from \"@open-pioneer/core\";\nimport { NotificationService } from \"@open-pioneer/notifier\";\nimport {\n PackageIntl,\n Service,\n ServiceOptions,\n type DECLARE_SERVICE_INTERFACE\n} from \"@open-pioneer/runtime\";\nimport Keycloak, {\n type KeycloakConfig,\n type KeycloakInitOptions,\n type KeycloakLoginOptions,\n type KeycloakLogoutOptions\n} from \"keycloak-js\";\nimport { KeycloakOptions, KeycloakProperties, RefreshOptions } from \"./api\";\n\nconst LOG = createLogger(\"authentication-keycloak:KeycloakAuthPlugin\");\n\ninterface References {\n notifier: NotificationService;\n}\n\nexport class KeycloakAuthPlugin implements Service, AuthPlugin {\n declare [DECLARE_SERVICE_INTERFACE]: \"authentication-keycloak.KeycloakAuthPlugin\";\n\n #notifier: NotificationService;\n #intl: PackageIntl;\n #keycloakOptions: KeycloakOptions;\n #keycloak: Keycloak;\n #logoutOptions: KeycloakLogoutOptions;\n #loginOptions: KeycloakLoginOptions;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n #timerId: any;\n #watcher: Resource | undefined;\n\n #state = reactive<AuthState>({\n kind: \"pending\"\n });\n\n constructor(options: ServiceOptions<References>) {\n this.#notifier = options.references.notifier;\n this.#intl = options.intl;\n this.#logoutOptions = { redirectUri: undefined };\n this.#loginOptions = { redirectUri: undefined };\n\n try {\n this.#keycloakOptions = getKeycloakConfig(options.properties);\n } catch (e) {\n throw new Error(\"Invalid keycloak configuration\", { cause: e });\n }\n\n try {\n this.#keycloak = new Keycloak(this.#keycloakOptions.keycloakConfig);\n } catch (e) {\n throw new Error(\"Failed to construct keycloak instance\", { cause: e });\n }\n this.#init().catch((e) => {\n this.#updateState({\n kind: \"error\",\n error: e\n });\n this.#notifier.notify({\n level: \"error\",\n title: this.#intl.formatMessage({\n id: \"loginFailed.title\"\n }),\n message: this.#intl.formatMessage({\n id: \"loginFailed.message\"\n })\n });\n\n LOG.error(\"Failed to check if user is authenticated\", e);\n });\n }\n\n destroy() {\n clearInterval(this.#timerId);\n this.#watcher = destroyResource(this.#watcher);\n this.#timerId = undefined;\n }\n\n getAuthState(): AuthState {\n return this.#state.value;\n }\n\n getLoginBehavior(): LoginBehavior {\n const doLogin = () => {\n LOG.debug(\"Login with options\", this.#loginOptions);\n this.#keycloak.login(this.#loginOptions);\n };\n return {\n kind: \"effect\",\n login: doLogin\n };\n }\n\n logout() {\n LOG.debug(\"Logout with options\", this.#logoutOptions);\n this.#keycloak.logout(this.#logoutOptions);\n }\n\n async #init() {\n const keycloakOptions = this.#keycloakOptions;\n const initOptions = this.#keycloakOptions.keycloakInitOptions;\n const refreshOptions = keycloakOptions.refreshOptions;\n\n let isAuthenticated: boolean;\n try {\n isAuthenticated = await this.#keycloak.init(initOptions);\n } catch (e) {\n // Note: keycloak.init() can also throw an exception, in addition to a rejected promise.\n // It may also just throw a string..\n const error = typeof e === \"string\" ? new Error(e) : e;\n throw new Error(\"Failed to initialize keycloak session\", { cause: error });\n }\n\n if (isAuthenticated) {\n this.#updateState({\n kind: \"authenticated\",\n sessionInfo: {\n userId: this.#keycloak.subject ? this.#keycloak.subject : \"undefined\",\n userName: this.#keycloak.idTokenParsed?.preferred_username,\n attributes: {\n keycloak: this.#keycloak,\n familyName: this.#keycloak.idTokenParsed?.family_name,\n givenName: this.#keycloak.idTokenParsed?.given_name,\n userName: this.#keycloak.idTokenParsed?.preferred_username\n }\n }\n });\n\n LOG.debug(`User ${this.#keycloak.subject} is authenticated`);\n\n if (refreshOptions.autoRefresh) {\n LOG.debug(\"Starting auto-refresh\", refreshOptions);\n this.__refresh(refreshOptions.interval, refreshOptions.timeLeft);\n }\n } else {\n this.#updateState({\n kind: \"not-authenticated\"\n });\n LOG.debug(\"User is not authenticated\");\n }\n }\n\n // Mocked in test\n private __refresh(interval: number, timeLeft: number) {\n clearInterval(this.#timerId);\n this.#timerId = setInterval(() => {\n this.#keycloak.updateToken(timeLeft).catch((e) => {\n LOG.error(\"Failed to refresh token\", e);\n this.#updateState({\n kind: \"not-authenticated\"\n });\n this.destroy();\n });\n }, interval);\n }\n\n #updateState(newState: AuthState) {\n this.#state.value = newState;\n }\n}\n\nconst DEFAULT_AUTO_REFRESH_OPT = {\n autoRefresh: true,\n interval: 6000,\n timeLeft: 70\n};\n\nconst DEFAULT_INIT_OPT = {\n onLoad: \"check-sso\",\n pkceMethod: \"S256\"\n};\n\nexport function getKeycloakConfig(properties: Partial<KeycloakProperties>): KeycloakOptions {\n const { keycloakOptions } = properties;\n\n const { refreshOptions, keycloakInitOptions, keycloakConfig } = keycloakOptions!;\n\n return {\n refreshOptions: { ...getRefreshOpt(refreshOptions) },\n keycloakInitOptions: { ...getInitOpt(keycloakInitOptions) },\n keycloakConfig: { ...getConfigOpt(keycloakConfig) }\n };\n}\n\nfunction getRefreshOpt(autoRefreshOptions: RefreshOptions | undefined): RefreshOptions {\n if (!autoRefreshOptions || isObjectEmpty(autoRefreshOptions)) {\n LOG.warn(\n `The autorefresh options of the Keycloak configuration should be set to ensure automatic refreshes at specified intervals.` +\n ` Defaulting to '${DEFAULT_AUTO_REFRESH_OPT}'.`\n );\n return Object.assign({}, { ...DEFAULT_AUTO_REFRESH_OPT });\n }\n return autoRefreshOptions;\n}\n\nfunction getInitOpt(keycloakInitOptions: KeycloakInitOptions | undefined): KeycloakInitOptions {\n if (!keycloakInitOptions || isObjectEmpty(keycloakInitOptions)) {\n LOG.warn(\n `The Keycloak init options of the keycloak configuration should be set.` +\n ` Defaulting to '${DEFAULT_INIT_OPT}'.`\n );\n return Object.assign({}, { ...DEFAULT_INIT_OPT }) as KeycloakInitOptions;\n }\n return keycloakInitOptions;\n}\n\nfunction getConfigOpt(keycloakConfig: KeycloakConfig | undefined): KeycloakConfig {\n if (!keycloakConfig || isObjectEmpty(keycloakConfig)) {\n throw new Error(\n `KeycloakConfig not found: The Keycloak configuration options are required by the plugin to perform login and logout operations`\n );\n }\n return keycloakConfig;\n}\n\nconst isObjectEmpty = (objectName: unknown) => {\n return objectName && Object.keys(objectName).length === 0 && objectName.constructor === Object;\n};\n"],"names":[],"mappings":";;;;AAoBA,MAAM,GAAA,GAAM,aAAa,4CAA4C,CAAA,CAAA;AAM9D,MAAM,kBAAkD,CAAA;AAAA,EAG3D,SAAA,CAAA;AAAA,EACA,KAAA,CAAA;AAAA,EACA,gBAAA,CAAA;AAAA,EACA,SAAA,CAAA;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AA,cAAA,CAAA;AACX,CAAA;AAEA,MAAM,aAAA,GAAgB,CAAC,UAAwB,KAAA;AAC3C,EAAO,OAAA,UAAA,IAAc,OAAO,IAAK,CAAA,UAAU,EAAE,MAAW,KAAA,CAAA,IAAK,WAAW,WAAgB,KAAA,MAAA,CAAA;AAC5F,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/authentication-keycloak",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.0-dev.20241120085048",
|
|
5
5
|
"description": "Implements authentication against Keycloak servers.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"directory": "src/packages/authentication-keycloak"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@conterra/reactivity-core": "^0.4.
|
|
17
|
+
"@conterra/reactivity-core": "^0.4.3",
|
|
18
18
|
"keycloak-js": "^25.0.2",
|
|
19
|
-
"@open-pioneer/authentication": "^2.
|
|
20
|
-
"@open-pioneer/
|
|
21
|
-
"@open-pioneer/runtime": "^2.
|
|
22
|
-
"@open-pioneer/
|
|
19
|
+
"@open-pioneer/authentication": "^2.4.0-dev.20241120085048",
|
|
20
|
+
"@open-pioneer/core": "^2.4.0-dev.20241120085048",
|
|
21
|
+
"@open-pioneer/runtime": "^2.4.0-dev.20241120085048",
|
|
22
|
+
"@open-pioneer/notifier": "^2.4.0-dev.20241120085048"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
"./package.json": "./package.json",
|