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