@open-pioneer/authentication-keycloak 4.9.0-dev.20261002130116 → 4.9.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/CHANGELOG.md +87 -85
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# @open-pioneer/authentication-keycloak
|
|
2
2
|
|
|
3
|
-
## 4.9.0
|
|
3
|
+
## 4.9.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- 6b160f3: A few minor fixes while cleaning up the code:
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
- The plugin reads the notification texts from `currentIntl`, so it no longer triggers the `ServiceOptions.intl` deprecation warning.
|
|
9
|
+
- The plugin no longer starts the token refresh timer or shows a notification when the service was destroyed while `keycloak.init()` was still pending.
|
|
10
|
+
|
|
11
|
+
- 42ca366: Update dependencies
|
|
10
12
|
|
|
11
13
|
## 4.8.0
|
|
12
14
|
|
|
@@ -70,53 +72,53 @@
|
|
|
70
72
|
|
|
71
73
|
- f67fd7e: Support configuration of keycloak's login options and logout options.
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
75
|
+
For example, to redirect to a different site after logout:
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
// app.ts
|
|
79
|
+
const element = createCustomElement({
|
|
80
|
+
component: AppUI,
|
|
81
|
+
appMetadata,
|
|
82
|
+
config: {
|
|
83
|
+
properties: {
|
|
84
|
+
"@open-pioneer/authentication-keycloak": {
|
|
85
|
+
keycloakOptions: {
|
|
86
|
+
// ...
|
|
87
|
+
keycloakLogoutOptions: {
|
|
88
|
+
redirectUri: "https://example.com"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} satisfies KeycloakProperties
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The plugin also supports options for the `logout` method to supply dynamic logout options:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
// via auth service
|
|
101
|
+
const authService = ...;
|
|
102
|
+
authService.logout({
|
|
103
|
+
// These are passed directly the keycloak plugin (if it is being used).
|
|
104
|
+
pluginOptions: {
|
|
105
|
+
redirectUri: "https://example.com",
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
// via direct reference to the plugin ("authentication-keycloak.KeycloakAuthPlugin")
|
|
110
|
+
const keycloakAuthPlugin = ...;
|
|
111
|
+
keycloakAuthPlugin.logout({
|
|
112
|
+
redirectUri: "https://example.com",
|
|
113
|
+
});
|
|
114
|
+
```
|
|
113
115
|
|
|
114
116
|
- f67fd7e: Make `RefreshOptions` optional with sensible default values. The default values have been changed to:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
- `autoRefresh`: true
|
|
118
|
+
- `interval` (for token lifetime checks): 10 seconds
|
|
119
|
+
- `timeLeft`: 60 seconds (minimum required lifetime during token validity checks)
|
|
118
120
|
|
|
119
|
-
|
|
121
|
+
These values are used when they are not explicitly configured using package properties.
|
|
120
122
|
|
|
121
123
|
### Patch Changes
|
|
122
124
|
|
|
@@ -140,13 +142,13 @@
|
|
|
140
142
|
### Major Changes
|
|
141
143
|
|
|
142
144
|
- 9477e54: Update dependencies
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
- React 19
|
|
146
|
+
- Vite 6
|
|
147
|
+
- FormatJS 3
|
|
148
|
+
- Open Pioneer Build Tools
|
|
149
|
+
- ...
|
|
148
150
|
|
|
149
|
-
|
|
151
|
+
For more details, see https://github.com/open-pioneer/trails-core-packages/pull/81
|
|
150
152
|
|
|
151
153
|
## 2.4.0
|
|
152
154
|
|
|
@@ -154,39 +156,39 @@
|
|
|
154
156
|
|
|
155
157
|
- 1ce5f11: Replace change events for auth state with signals from Reactivity API
|
|
156
158
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
159
|
+
Example: watch for updates of the auth state
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
const myAuthService = ...
|
|
163
|
+
watch(
|
|
164
|
+
() => [myAuthService.getAuthState()],
|
|
165
|
+
([state]) => {
|
|
166
|
+
console.log(state);
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
immediate: true
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The Auth Service forwards the auth state from the underlying AuthPlugin.
|
|
175
|
+
Therefore, the plugin implementation must use reactive signals when its auth state changes in order to signal changes to the service.
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
class DummyPlugin implements AuthPlugin {
|
|
179
|
+
#state = reactive<AuthState>({
|
|
180
|
+
kind: "not-authenticated"
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
getAuthState(): AuthState {
|
|
184
|
+
return this.#state.value;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
$setAuthState(newState: AuthState) {
|
|
188
|
+
this.#state.value = newState;
|
|
189
|
+
}
|
|
187
190
|
}
|
|
188
|
-
|
|
189
|
-
```
|
|
191
|
+
```
|
|
190
192
|
|
|
191
193
|
### Patch Changes
|
|
192
194
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/authentication-keycloak",
|
|
4
|
-
"version": "4.9.0
|
|
4
|
+
"version": "4.9.0",
|
|
5
5
|
"description": "Implements authentication against Keycloak servers.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"directory": "src/packages/authentication-keycloak"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@conterra/reactivity-core": "^0.8.
|
|
18
|
-
"@open-pioneer/authentication": "4.9.0
|
|
19
|
-
"@open-pioneer/core": "4.9.0
|
|
20
|
-
"@open-pioneer/notifier": "4.9.0
|
|
21
|
-
"@open-pioneer/runtime": "4.9.0
|
|
17
|
+
"@conterra/reactivity-core": "^0.8.9",
|
|
18
|
+
"@open-pioneer/authentication": "4.9.0",
|
|
19
|
+
"@open-pioneer/core": "4.9.0",
|
|
20
|
+
"@open-pioneer/notifier": "4.9.0",
|
|
21
|
+
"@open-pioneer/runtime": "4.9.0",
|
|
22
22
|
"keycloak-js": "^26.2.4"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|