@valtimo/keycloak 12.19.0 → 13.0.1-next-minor.81
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/fesm2022/valtimo-keycloak.mjs +41 -42
- package/fesm2022/valtimo-keycloak.mjs.map +1 -1
- package/lib/callback.component.d.ts.map +1 -1
- package/lib/services/keycloak-options.service.d.ts +1 -1
- package/lib/services/keycloak-user.service.d.ts +1 -1
- package/lib/services/keycloak-user.service.d.ts.map +1 -1
- package/package.json +6 -8
- package/esm2022/lib/callback.component.mjs +0 -63
- package/esm2022/lib/constants/index.mjs +0 -17
- package/esm2022/lib/constants/storage-keys.mjs +0 -23
- package/esm2022/lib/keycloak-routing.module.mjs +0 -41
- package/esm2022/lib/keycloak.init.mjs +0 -48
- package/esm2022/lib/keycloak.module.mjs +0 -37
- package/esm2022/lib/models/index.mjs +0 -17
- package/esm2022/lib/models/keycloak.config.mjs +0 -17
- package/esm2022/lib/services/index.mjs +0 -20
- package/esm2022/lib/services/keycloak-auth-guard.service.mjs +0 -59
- package/esm2022/lib/services/keycloak-options.service.mjs +0 -24
- package/esm2022/lib/services/keycloak-storage.service.mjs +0 -43
- package/esm2022/lib/services/keycloak-user.service.mjs +0 -178
- package/esm2022/public_api.mjs +0 -27
- package/esm2022/valtimo-keycloak.mjs +0 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, Component, NgModule } from '@angular/core';
|
|
3
3
|
import * as i2 from 'keycloak-angular';
|
|
4
|
-
import { KeycloakAuthGuard,
|
|
4
|
+
import { KeycloakAuthGuard, KeycloakEventTypeLegacy, KeycloakAngularModule, KeycloakService } from 'keycloak-angular';
|
|
5
5
|
import * as i1 from '@angular/router';
|
|
6
6
|
import { RouterModule } from '@angular/router';
|
|
7
7
|
import * as i3 from 'ngx-logger';
|
|
8
8
|
import { NGXLogger } from 'ngx-logger';
|
|
9
|
-
import * as i1$1 from '@valtimo/
|
|
10
|
-
import { ValtimoUserIdentity } from '@valtimo/
|
|
9
|
+
import * as i1$1 from '@valtimo/shared';
|
|
10
|
+
import { ValtimoUserIdentity } from '@valtimo/shared';
|
|
11
11
|
import { Subject, ReplaySubject, timer, switchMap, combineLatest } from 'rxjs';
|
|
12
12
|
import { jwtDecode } from 'jwt-decode';
|
|
13
13
|
import { take } from 'rxjs/operators';
|
|
@@ -18,7 +18,7 @@ import * as i6 from '@angular/common';
|
|
|
18
18
|
import { CommonModule, DatePipe } from '@angular/common';
|
|
19
19
|
|
|
20
20
|
/*
|
|
21
|
-
* Copyright 2015-
|
|
21
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
22
22
|
*
|
|
23
23
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
24
24
|
* you may not use this file except in compliance with the License.
|
|
@@ -34,7 +34,7 @@ import { CommonModule, DatePipe } from '@angular/common';
|
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
36
|
/*
|
|
37
|
-
* Copyright 2015-
|
|
37
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
38
38
|
*
|
|
39
39
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
40
40
|
* you may not use this file except in compliance with the License.
|
|
@@ -50,7 +50,7 @@ import { CommonModule, DatePipe } from '@angular/common';
|
|
|
50
50
|
*/
|
|
51
51
|
|
|
52
52
|
/*
|
|
53
|
-
* Copyright 2015-
|
|
53
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
54
54
|
*
|
|
55
55
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
56
56
|
* you may not use this file except in compliance with the License.
|
|
@@ -72,7 +72,7 @@ const STORAGE_KEYS = {
|
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
/*
|
|
75
|
-
* Copyright 2015-
|
|
75
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
76
76
|
*
|
|
77
77
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
78
78
|
* you may not use this file except in compliance with the License.
|
|
@@ -88,7 +88,7 @@ const STORAGE_KEYS = {
|
|
|
88
88
|
*/
|
|
89
89
|
|
|
90
90
|
/*
|
|
91
|
-
* Copyright 2015-
|
|
91
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
92
92
|
*
|
|
93
93
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
94
94
|
* you may not use this file except in compliance with the License.
|
|
@@ -130,10 +130,10 @@ class KeycloakAuthGuardService extends KeycloakAuthGuard {
|
|
|
130
130
|
resolve(requiredRoles.some(role => this.roles.includes(role)));
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
134
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
133
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakAuthGuardService, deps: [{ token: i1.Router }, { token: i2.KeycloakService }, { token: i3.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
134
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakAuthGuardService, providedIn: 'root' }); }
|
|
135
135
|
}
|
|
136
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakAuthGuardService, decorators: [{
|
|
137
137
|
type: Injectable,
|
|
138
138
|
args: [{
|
|
139
139
|
providedIn: 'root',
|
|
@@ -151,10 +151,10 @@ class KeycloakOptionsService {
|
|
|
151
151
|
get logoutRedirectUri() {
|
|
152
152
|
return this.valtimoKeycloakOptions.logoutRedirectUri;
|
|
153
153
|
}
|
|
154
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
155
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
154
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakOptionsService, deps: [{ token: i1$1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
155
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakOptionsService, providedIn: 'root' }); }
|
|
156
156
|
}
|
|
157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakOptionsService, decorators: [{
|
|
158
158
|
type: Injectable,
|
|
159
159
|
args: [{
|
|
160
160
|
providedIn: 'root',
|
|
@@ -162,7 +162,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
162
162
|
}], ctorParameters: () => [{ type: i1$1.ConfigService }] });
|
|
163
163
|
|
|
164
164
|
/*
|
|
165
|
-
* Copyright 2015-
|
|
165
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
166
166
|
*
|
|
167
167
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
168
168
|
* you may not use this file except in compliance with the License.
|
|
@@ -192,10 +192,10 @@ class KeycloakStorageService {
|
|
|
192
192
|
JSON.parse(savedParams)) ||
|
|
193
193
|
{});
|
|
194
194
|
}
|
|
195
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
196
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
195
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
196
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakStorageService, providedIn: 'root' }); }
|
|
197
197
|
}
|
|
198
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
198
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakStorageService, decorators: [{
|
|
199
199
|
type: Injectable,
|
|
200
200
|
args: [{
|
|
201
201
|
providedIn: 'root',
|
|
@@ -203,7 +203,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
203
203
|
}] });
|
|
204
204
|
|
|
205
205
|
/*
|
|
206
|
-
* Copyright 2015-
|
|
206
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
207
207
|
*
|
|
208
208
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
209
209
|
* you may not use this file except in compliance with the License.
|
|
@@ -269,7 +269,7 @@ class KeycloakUserService {
|
|
|
269
269
|
}
|
|
270
270
|
openTokenRefreshSubscription() {
|
|
271
271
|
this.tokenRefreshSubscription = this.keycloakService.keycloakEvents$.subscribe(keycloakEvent => {
|
|
272
|
-
if (keycloakEvent.type ===
|
|
272
|
+
if (keycloakEvent.type === KeycloakEventTypeLegacy.OnAuthRefreshSuccess) {
|
|
273
273
|
this.setRefreshToken();
|
|
274
274
|
}
|
|
275
275
|
});
|
|
@@ -333,8 +333,6 @@ class KeycloakUserService {
|
|
|
333
333
|
bodyText,
|
|
334
334
|
cancelButtonText,
|
|
335
335
|
confirmButtonText,
|
|
336
|
-
cancelMdiIcon: 'logout',
|
|
337
|
-
confirmMdiIcon: 'check',
|
|
338
336
|
closeOnConfirm: true,
|
|
339
337
|
closeOnCancel: false,
|
|
340
338
|
cancelCallbackFunction: () => {
|
|
@@ -353,10 +351,10 @@ class KeycloakUserService {
|
|
|
353
351
|
sessionStorage.setItem(STORAGE_KEYS.urlBeforeExpirationParams, this.keycloakStorageService.getCurrentUrlParams());
|
|
354
352
|
}
|
|
355
353
|
}
|
|
356
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
357
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
354
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakUserService, deps: [{ token: i2.KeycloakService }, { token: KeycloakOptionsService }, { token: i3.NGXLogger }, { token: i4.PromptService }, { token: i5.TranslateService }, { token: i6.DatePipe }, { token: i1$1.ConfigService }, { token: i1.Router }, { token: KeycloakStorageService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
355
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakUserService, providedIn: 'root' }); }
|
|
358
356
|
}
|
|
359
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakUserService, decorators: [{
|
|
360
358
|
type: Injectable,
|
|
361
359
|
args: [{
|
|
362
360
|
providedIn: 'root',
|
|
@@ -364,7 +362,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
364
362
|
}], ctorParameters: () => [{ type: i2.KeycloakService }, { type: KeycloakOptionsService }, { type: i3.NGXLogger }, { type: i4.PromptService }, { type: i5.TranslateService }, { type: i6.DatePipe }, { type: i1$1.ConfigService }, { type: i1.Router }, { type: KeycloakStorageService }] });
|
|
365
363
|
|
|
366
364
|
/*
|
|
367
|
-
* Copyright 2015-
|
|
365
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
368
366
|
*
|
|
369
367
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
370
368
|
* you may not use this file except in compliance with the License.
|
|
@@ -380,7 +378,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
380
378
|
*/
|
|
381
379
|
|
|
382
380
|
/*
|
|
383
|
-
* Copyright 2015-
|
|
381
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
384
382
|
*
|
|
385
383
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
386
384
|
* you may not use this file except in compliance with the License.
|
|
@@ -425,19 +423,20 @@ class CallbackComponent {
|
|
|
425
423
|
this.router.navigate([redirectTo], { queryParams: parsedSavedRedirectToParams });
|
|
426
424
|
}
|
|
427
425
|
}
|
|
428
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
429
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
426
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CallbackComponent, deps: [{ token: i1.Router }, { token: KeycloakOptionsService }, { token: i3.NGXLogger }, { token: KeycloakStorageService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
427
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: CallbackComponent, isStandalone: false, selector: "valtimo-keycloak-callback", ngImport: i0, template: '', isInline: true }); }
|
|
430
428
|
}
|
|
431
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: CallbackComponent, decorators: [{
|
|
432
430
|
type: Component,
|
|
433
431
|
args: [{
|
|
432
|
+
standalone: false,
|
|
434
433
|
selector: 'valtimo-keycloak-callback',
|
|
435
434
|
template: '',
|
|
436
435
|
}]
|
|
437
436
|
}], ctorParameters: () => [{ type: i1.Router }, { type: KeycloakOptionsService }, { type: i3.NGXLogger }, { type: KeycloakStorageService }] });
|
|
438
437
|
|
|
439
438
|
/*
|
|
440
|
-
* Copyright 2015-
|
|
439
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
441
440
|
*
|
|
442
441
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
443
442
|
* you may not use this file except in compliance with the License.
|
|
@@ -459,11 +458,11 @@ const routes = [
|
|
|
459
458
|
},
|
|
460
459
|
];
|
|
461
460
|
class KeycloakRoutingModule {
|
|
462
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
463
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
464
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
461
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
462
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: KeycloakRoutingModule, imports: [CommonModule, i1.RouterModule], exports: [RouterModule] }); }
|
|
463
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] }); }
|
|
465
464
|
}
|
|
466
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
465
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakRoutingModule, decorators: [{
|
|
467
466
|
type: NgModule,
|
|
468
467
|
args: [{
|
|
469
468
|
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
@@ -472,7 +471,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
472
471
|
}] });
|
|
473
472
|
|
|
474
473
|
/*
|
|
475
|
-
* Copyright 2015-
|
|
474
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
476
475
|
*
|
|
477
476
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
478
477
|
* you may not use this file except in compliance with the License.
|
|
@@ -487,11 +486,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
487
486
|
* limitations under the License.
|
|
488
487
|
*/
|
|
489
488
|
class KeycloakModule {
|
|
490
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
491
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
492
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
489
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
490
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: KeycloakModule, declarations: [CallbackComponent], imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule], exports: [CallbackComponent] }); }
|
|
491
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakModule, providers: [DatePipe], imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule] }); }
|
|
493
492
|
}
|
|
494
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
493
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: KeycloakModule, decorators: [{
|
|
495
494
|
type: NgModule,
|
|
496
495
|
args: [{
|
|
497
496
|
declarations: [CallbackComponent],
|
|
@@ -502,7 +501,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
|
|
|
502
501
|
}] });
|
|
503
502
|
|
|
504
503
|
/*
|
|
505
|
-
* Copyright 2015-
|
|
504
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
506
505
|
*
|
|
507
506
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
508
507
|
* you may not use this file except in compliance with the License.
|
|
@@ -546,7 +545,7 @@ function keycloakInitializer(injector) {
|
|
|
546
545
|
}
|
|
547
546
|
|
|
548
547
|
/*
|
|
549
|
-
* Copyright 2015-
|
|
548
|
+
* Copyright 2015-2025 Ritense BV, the Netherlands.
|
|
550
549
|
*
|
|
551
550
|
* Licensed under EUPL, Version 1.2 (the "License");
|
|
552
551
|
* you may not use this file except in compliance with the License.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valtimo-keycloak.mjs","sources":["../../../../projects/valtimo/keycloak/src/lib/models/keycloak.config.ts","../../../../projects/valtimo/keycloak/src/lib/models/index.ts","../../../../projects/valtimo/keycloak/src/lib/constants/storage-keys.ts","../../../../projects/valtimo/keycloak/src/lib/constants/index.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-auth-guard.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-options.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-storage.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-user.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/index.ts","../../../../projects/valtimo/keycloak/src/lib/callback.component.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-routing.module.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak.module.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak.init.ts","../../../../projects/valtimo/keycloak/src/public_api.ts","../../../../projects/valtimo/keycloak/src/valtimo-keycloak.ts"],"sourcesContent":["/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {KeycloakOptions} from 'keycloak-angular';\n\nexport interface ValtimoKeycloakOptions {\n keycloakOptions: KeycloakOptions;\n logoutRedirectUri: string;\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './keycloak.config';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst STORAGE_KEYS = {\n urlBeforeExpiration: 'urlBeforeExpiration',\n urlBeforeExpirationParams: 'urlBeforeExpirationParams',\n redirectTo: 'redirectTo',\n redirectToParams: 'redirectToParams',\n};\n\nexport {STORAGE_KEYS};\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './storage-keys';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {KeycloakAuthGuard, KeycloakService} from 'keycloak-angular';\nimport {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakAuthGuardService extends KeycloakAuthGuard implements CanActivate {\n constructor(\n protected router: Router,\n protected keycloakAngular: KeycloakService,\n private logger: NGXLogger\n ) {\n super(router, keycloakAngular);\n this.logger.debug('KeycloakAuthGuardService: ctor');\n }\n\n isAccessAllowed(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> {\n this.logger.debug('KeycloakAuthGuardService: isAccessAllowed');\n return new Promise((resolve, reject) => {\n this.logger.debug('KeycloakAuthGuardService: isAccessAllowed checking access');\n if (!this.authenticated) {\n this.keycloakAngular\n .login()\n .catch(e => `KeycloakAuthGuardService error: ${this.logger.error(e)}`);\n return reject(false);\n }\n\n const requiredRoles: string[] = route.data.roles;\n\n if (!requiredRoles || requiredRoles.length === 0) {\n return resolve(true);\n }\n\n if (!this.roles || this.roles.length === 0) {\n resolve(false);\n }\n resolve(requiredRoles.some(role => this.roles.includes(role)));\n });\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {ValtimoKeycloakOptions} from '../models';\nimport {Injectable} from '@angular/core';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakOptionsService {\n private readonly valtimoKeycloakOptions: ValtimoKeycloakOptions;\n\n constructor(private configService: ConfigService) {\n this.valtimoKeycloakOptions = configService.config.authentication.options;\n }\n\n get keycloakOptions() {\n return this.valtimoKeycloakOptions.keycloakOptions;\n }\n\n get logoutRedirectUri() {\n return this.valtimoKeycloakOptions.logoutRedirectUri;\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakStorageService {\n getCurrentUrlParams(): string {\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n return JSON.stringify(params);\n }\n\n getCurrentUrl(): string {\n return window.location.pathname;\n }\n\n parseSavedParams(savedParams: any): {[key: string]: string} {\n return (\n (savedParams &&\n typeof savedParams === 'string' &&\n savedParams.length > 2 &&\n JSON.parse(savedParams)) ||\n {}\n );\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable, OnDestroy} from '@angular/core';\nimport {combineLatest, map, ReplaySubject, Subject, Subscription, switchMap, timer} from 'rxjs';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakEventType, KeycloakService} from 'keycloak-angular';\nimport {ConfigService, UserIdentity, UserService, ValtimoUserIdentity} from '@valtimo/config';\nimport {KeycloakOptionsService} from './keycloak-options.service';\nimport {jwtDecode} from 'jwt-decode';\nimport {TranslateService} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\nimport {take} from 'rxjs/operators';\nimport {Router} from '@angular/router';\nimport {STORAGE_KEYS} from '../constants';\nimport {KeycloakStorageService} from './keycloak-storage.service';\nimport {PromptService} from '@valtimo/components';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakUserService implements UserService, OnDestroy {\n private userIdentity: ReplaySubject<UserIdentity>;\n\n private tokenRefreshSubscription!: Subscription;\n private refreshTokenSubscription!: Subscription;\n private expiryTimerSubscription!: Subscription;\n\n private readonly _refreshToken$ = new Subject<string>();\n\n private _tokenExp!: number;\n\n private readonly FIVE_MINUTES_MS = 300000;\n private readonly EXPIRE_TOKEN_CONFIRMATION = 'EXPIRE_TOKEN_CONFIRMATION';\n\n private _counter!: Date;\n\n constructor(\n private readonly keycloakService: KeycloakService,\n private readonly keycloakOptionsService: KeycloakOptionsService,\n private readonly logger: NGXLogger,\n private readonly promptService: PromptService,\n private readonly translateService: TranslateService,\n private readonly datePipe: DatePipe,\n private readonly configService: ConfigService,\n private readonly router: Router,\n private readonly keycloakStorageService: KeycloakStorageService\n ) {\n this.openTokenRefreshSubscription();\n this.openRefreshTokenSubscription();\n }\n\n ngOnDestroy(): void {\n this.tokenRefreshSubscription?.unsubscribe();\n this.refreshTokenSubscription?.unsubscribe();\n this.closeExpiryTimerSubscription();\n }\n\n init(): void {\n this.userIdentity = new ReplaySubject();\n this.keycloakService.loadUserProfile().then(user => {\n this.logger.debug('KeycloakUserService: loadUserProfile = ', user);\n const roles: Array<string> = [];\n this.keycloakService.getUserRoles(true).forEach(role => roles.push(role));\n const valtimoUserIdentity = new ValtimoUserIdentity(\n user.email,\n user.firstName,\n user.lastName,\n roles,\n user.username,\n user.id\n );\n this.logger.debug('KeycloakUserService: loaded user identity', valtimoUserIdentity);\n this.userIdentity.next(valtimoUserIdentity);\n });\n this.setRefreshToken();\n }\n\n getUserSubject(): ReplaySubject<UserIdentity> {\n this.logger.debug('KeycloakUserService: getUserIdentity');\n return this.userIdentity;\n }\n\n logout(): void {\n this.logger.debug('KeycloakUserService: logout');\n this.keycloakService.logout(this.keycloakOptionsService.logoutRedirectUri);\n }\n\n async getToken(): Promise<string> {\n this.logger.debug('KeycloakUserService: getToken');\n return this.keycloakService.getToken();\n }\n\n async updateToken(minValidity: number): Promise<boolean> {\n this.logger.debug('KeycloakUserService: updateToken');\n return this.keycloakService.updateToken(minValidity);\n }\n\n private openTokenRefreshSubscription(): void {\n this.tokenRefreshSubscription = this.keycloakService.keycloakEvents$.subscribe(\n keycloakEvent => {\n if (keycloakEvent.type === KeycloakEventType.OnAuthRefreshSuccess) {\n this.setRefreshToken();\n }\n }\n );\n }\n\n private get _expiryTimeMs() {\n return this._tokenExp - Date.now() - 1000;\n }\n\n private openRefreshTokenSubscription(): void {\n this.refreshTokenSubscription = this._refreshToken$.subscribe(refreshToken => {\n const decodedRefreshToken = jwtDecode(refreshToken);\n this._tokenExp = decodedRefreshToken.exp * 1000;\n\n this.closeExpiryTimerSubscription();\n this.openExpiryTimerSubscription();\n });\n }\n\n private setRefreshToken(): void {\n const refreshToken = this.keycloakService.getKeycloakInstance()?.refreshToken;\n if (refreshToken) this._refreshToken$.next(refreshToken);\n }\n\n private openExpiryTimerSubscription(): void {\n this.expiryTimerSubscription = timer(0, 1000)\n .pipe(\n switchMap(() => {\n if (this._expiryTimeMs <= this.FIVE_MINUTES_MS) {\n this._counter = new Date(0, 0, 0, 0, 0, 0);\n this._counter.setSeconds(this._expiryTimeMs / 1000);\n }\n\n return combineLatest([\n this.promptService.promptVisible$,\n this.translateService.stream('keycloak.expiryPromptTitle'),\n this.translateService.stream('keycloak.expiryPromptDescription', {\n expiryTime: this.datePipe.transform(this._counter, 'mm:ss'),\n }),\n this.translateService.stream('keycloak.expiryPromptCancel'),\n this.translateService.stream('keycloak.expiryPromptConfirm'),\n ]);\n })\n )\n .subscribe(([promptVisible, headerText, bodyText, cancelButtonText, confirmButtonText]) => {\n this.promptService.identifier$.pipe(take(1)).subscribe(identifier => {\n if (\n (!promptVisible || identifier !== this.EXPIRE_TOKEN_CONFIRMATION) &&\n this._expiryTimeMs <= this.FIVE_MINUTES_MS\n ) {\n this.openConfirmationPrompt(headerText, bodyText, cancelButtonText, confirmButtonText);\n }\n\n if (promptVisible && identifier === this.EXPIRE_TOKEN_CONFIRMATION) {\n this.promptService.setBodyText(bodyText);\n }\n });\n\n if (this._expiryTimeMs < 2000) {\n this.saveUrl();\n this.logout();\n }\n });\n }\n\n private closeExpiryTimerSubscription(): void {\n this.expiryTimerSubscription?.unsubscribe();\n }\n\n private openConfirmationPrompt(\n headerText: string,\n bodyText: string,\n cancelButtonText: string,\n confirmButtonText: string\n ): void {\n this.promptService.openPrompt({\n identifier: this.EXPIRE_TOKEN_CONFIRMATION,\n headerText,\n bodyText,\n cancelButtonText,\n confirmButtonText,\n cancelMdiIcon: 'logout',\n confirmMdiIcon: 'check',\n closeOnConfirm: true,\n closeOnCancel: false,\n cancelCallbackFunction: () => {\n this.keycloakService.logout();\n },\n confirmCallBackFunction: () => {\n this.closeExpiryTimerSubscription();\n this.updateToken(20);\n },\n });\n }\n\n private saveUrl(): void {\n const returnToLastUrlAfterTokenExpiration =\n this.configService?.config?.featureToggles?.returnToLastUrlAfterTokenExpiration;\n\n if (returnToLastUrlAfterTokenExpiration) {\n sessionStorage.setItem(\n STORAGE_KEYS.urlBeforeExpiration,\n this.keycloakStorageService.getCurrentUrl()\n );\n sessionStorage.setItem(\n STORAGE_KEYS.urlBeforeExpirationParams,\n this.keycloakStorageService.getCurrentUrlParams()\n );\n }\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './keycloak-auth-guard.service';\nexport * from './keycloak-options.service';\nexport * from './keycloak-user.service';\nexport * from './keycloak-storage.service';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakOptionsService, KeycloakStorageService} from './services';\nimport {STORAGE_KEYS} from './constants';\n\n@Component({\n selector: 'valtimo-keycloak-callback',\n template: '',\n})\nexport class CallbackComponent {\n constructor(\n private router: Router,\n private keycloakOptionsService: KeycloakOptionsService,\n private logger: NGXLogger,\n private readonly keycloakStorageService: KeycloakStorageService\n ) {\n logger.debug('callback');\n const savedRedirectTo = window.sessionStorage.getItem(STORAGE_KEYS.redirectTo);\n const savedRedirectToParams = window.sessionStorage.getItem(STORAGE_KEYS.redirectToParams);\n const parsedSavedRedirectToParams =\n this.keycloakStorageService.parseSavedParams(savedRedirectToParams);\n\n const urlBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpiration);\n const paramsBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpirationParams);\n const parsedParamsBeforeExpiration =\n this.keycloakStorageService.parseSavedParams(paramsBeforeExpiration);\n\n let redirectTo!: string;\n\n if (savedRedirectTo) {\n redirectTo = savedRedirectTo;\n } else {\n redirectTo = '/';\n }\n\n logger.debug('keycloak callback redirect =', redirectTo);\n logger.debug('keycloak callback redirect params =', savedRedirectToParams);\n\n if (STORAGE_KEYS.urlBeforeExpiration in sessionStorage) {\n this.router.navigate([urlBeforeExpiration], {queryParams: parsedParamsBeforeExpiration});\n sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpiration);\n sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpirationParams);\n } else {\n this.router.navigate([redirectTo], {queryParams: parsedSavedRedirectToParams});\n }\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CallbackComponent} from './callback.component';\nimport {CommonModule} from '@angular/common';\n\nconst routes: Routes = [\n {\n path: 'keycloak/callback',\n component: CallbackComponent,\n data: {title: 'Loading...'},\n },\n];\n\n@NgModule({\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class KeycloakRoutingModule {}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {KeycloakAngularModule} from 'keycloak-angular';\nimport {CallbackComponent} from './callback.component';\nimport {KeycloakRoutingModule} from './keycloak-routing.module';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\n\n@NgModule({\n declarations: [CallbackComponent],\n imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule],\n exports: [CallbackComponent],\n providers: [DatePipe],\n})\nexport class KeycloakModule {}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {KeycloakService} from 'keycloak-angular';\nimport {KeycloakOptionsService, KeycloakStorageService, KeycloakUserService} from './services';\nimport {Injector} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {STORAGE_KEYS} from './constants';\n\nexport function keycloakInitializer(injector: Injector): () => Promise<any> {\n const keycloakService = injector.get<KeycloakService>(KeycloakService);\n const keycloakUserService = injector.get<KeycloakUserService>(KeycloakUserService);\n const optionsService = injector.get<KeycloakOptionsService>(KeycloakOptionsService); // TODO possible removal of abstraction\n const storageService = injector.get<KeycloakStorageService>(KeycloakStorageService);\n const logger = injector.get<NGXLogger>(NGXLogger);\n\n return async (): Promise<any> => {\n try {\n logger.debug('Keycloak initializer before init');\n\n const keycloakOptions = optionsService.keycloakOptions;\n const currentUrl = window.location.href.split('#')[0];\n\n if (keycloakOptions.initOptions.redirectUri !== currentUrl) {\n const redirectTo = storageService.getCurrentUrl();\n logger.debug('Setting redirectTo =', redirectTo);\n window.sessionStorage.setItem(STORAGE_KEYS.redirectTo, redirectTo);\n window.sessionStorage.setItem(\n STORAGE_KEYS.redirectToParams,\n storageService.getCurrentUrlParams()\n );\n }\n\n const initResult = await keycloakService.init(keycloakOptions);\n logger.debug('Keycloak initializer after init');\n\n keycloakUserService.init();\n\n return initResult;\n } catch (error) {\n logger.debug('Keycloak initializer error', error);\n throw error;\n }\n };\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of keycloak\n */\n\nexport * from './lib/models';\nexport * from './lib/keycloak.module';\nexport * from './lib/services/keycloak-auth-guard.service';\nexport * from './lib/services/keycloak-user.service';\nexport * from './lib/keycloak.init';\nexport * from './lib/services/keycloak-options.service';\nexport * from './lib/callback.component';\nexport * from './lib/constants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i2.KeycloakOptionsService","i7","i8","i9.KeycloakStorageService","i2.KeycloakStorageService"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;AAEH,MAAM,YAAY,GAAG;AACnB,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,yBAAyB,EAAE,2BAA2B;AACtD,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,gBAAgB,EAAE,kBAAkB;;;ACpBtC;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;AAUG,MAAO,wBAAyB,SAAQ,iBAAiB,CAAA;AAC7D,IAAA,WAAA,CACY,MAAc,EACd,eAAgC,EAClC,MAAiB,EAAA;AAEzB,QAAA,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC;QAJpB,IAAA,CAAA,MAAM,GAAN,MAAM;QACN,IAAA,CAAA,eAAe,GAAf,eAAe;QACjB,IAAA,CAAA,MAAM,GAAN,MAAM;AAGd,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC;IACrD;IAEA,eAAe,CAAC,KAA6B,EAAE,KAA0B,EAAA;AACvE,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2CAA2C,CAAC;QAC9D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACrC,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2DAA2D,CAAC;AAC9E,YAAA,IAAI,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YAAA,MAAM,KAAK;QACb;AACF,IAAA,CAAC;AACH;;ACzDA;;;;;;;;;;;;;;AAcG;AAEH;;AAEG;;AClBH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"valtimo-keycloak.mjs","sources":["../../../../projects/valtimo/keycloak/src/lib/models/keycloak.config.ts","../../../../projects/valtimo/keycloak/src/lib/models/index.ts","../../../../projects/valtimo/keycloak/src/lib/constants/storage-keys.ts","../../../../projects/valtimo/keycloak/src/lib/constants/index.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-auth-guard.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-options.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-storage.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-user.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/index.ts","../../../../projects/valtimo/keycloak/src/lib/callback.component.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-routing.module.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak.module.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak.init.ts","../../../../projects/valtimo/keycloak/src/public_api.ts","../../../../projects/valtimo/keycloak/src/valtimo-keycloak.ts"],"sourcesContent":["/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {KeycloakOptions} from 'keycloak-angular';\n\nexport interface ValtimoKeycloakOptions {\n keycloakOptions: KeycloakOptions;\n logoutRedirectUri: string;\n}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './keycloak.config';\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst STORAGE_KEYS = {\n urlBeforeExpiration: 'urlBeforeExpiration',\n urlBeforeExpirationParams: 'urlBeforeExpirationParams',\n redirectTo: 'redirectTo',\n redirectToParams: 'redirectToParams',\n};\n\nexport {STORAGE_KEYS};\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './storage-keys';\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {KeycloakAuthGuard, KeycloakService} from 'keycloak-angular';\nimport {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakAuthGuardService extends KeycloakAuthGuard implements CanActivate {\n constructor(\n protected router: Router,\n protected keycloakAngular: KeycloakService,\n private logger: NGXLogger\n ) {\n super(router, keycloakAngular);\n this.logger.debug('KeycloakAuthGuardService: ctor');\n }\n\n isAccessAllowed(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> {\n this.logger.debug('KeycloakAuthGuardService: isAccessAllowed');\n return new Promise((resolve, reject) => {\n this.logger.debug('KeycloakAuthGuardService: isAccessAllowed checking access');\n if (!this.authenticated) {\n this.keycloakAngular\n .login()\n .catch(e => `KeycloakAuthGuardService error: ${this.logger.error(e)}`);\n return reject(false);\n }\n\n const requiredRoles: string[] = route.data.roles;\n\n if (!requiredRoles || requiredRoles.length === 0) {\n return resolve(true);\n }\n\n if (!this.roles || this.roles.length === 0) {\n resolve(false);\n }\n resolve(requiredRoles.some(role => this.roles.includes(role)));\n });\n }\n}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {ValtimoKeycloakOptions} from '../models';\nimport {Injectable} from '@angular/core';\nimport {ConfigService} from '@valtimo/shared';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakOptionsService {\n private readonly valtimoKeycloakOptions: ValtimoKeycloakOptions;\n\n constructor(private configService: ConfigService) {\n this.valtimoKeycloakOptions = configService.config.authentication.options;\n }\n\n get keycloakOptions() {\n return this.valtimoKeycloakOptions.keycloakOptions;\n }\n\n get logoutRedirectUri() {\n return this.valtimoKeycloakOptions.logoutRedirectUri;\n }\n}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakStorageService {\n getCurrentUrlParams(): string {\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n return JSON.stringify(params);\n }\n\n getCurrentUrl(): string {\n return window.location.pathname;\n }\n\n parseSavedParams(savedParams: any): {[key: string]: string} {\n return (\n (savedParams &&\n typeof savedParams === 'string' &&\n savedParams.length > 2 &&\n JSON.parse(savedParams)) ||\n {}\n );\n }\n}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable, OnDestroy} from '@angular/core';\nimport {combineLatest, ReplaySubject, Subject, Subscription, switchMap, timer} from 'rxjs';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakEventTypeLegacy, KeycloakService} from 'keycloak-angular';\nimport {ConfigService, UserIdentity, UserService, ValtimoUserIdentity} from '@valtimo/shared';\nimport {KeycloakOptionsService} from './keycloak-options.service';\nimport {jwtDecode} from 'jwt-decode';\nimport {TranslateService} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\nimport {take} from 'rxjs/operators';\nimport {Router} from '@angular/router';\nimport {STORAGE_KEYS} from '../constants';\nimport {KeycloakStorageService} from './keycloak-storage.service';\nimport {PromptService} from '@valtimo/components';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakUserService implements UserService, OnDestroy {\n private userIdentity: ReplaySubject<UserIdentity>;\n\n private tokenRefreshSubscription!: Subscription;\n private refreshTokenSubscription!: Subscription;\n private expiryTimerSubscription!: Subscription;\n\n private readonly _refreshToken$ = new Subject<string>();\n\n private _tokenExp!: number;\n\n private readonly FIVE_MINUTES_MS = 300000;\n private readonly EXPIRE_TOKEN_CONFIRMATION = 'EXPIRE_TOKEN_CONFIRMATION';\n\n private _counter!: Date;\n\n constructor(\n private readonly keycloakService: KeycloakService,\n private readonly keycloakOptionsService: KeycloakOptionsService,\n private readonly logger: NGXLogger,\n private readonly promptService: PromptService,\n private readonly translateService: TranslateService,\n private readonly datePipe: DatePipe,\n private readonly configService: ConfigService,\n private readonly router: Router,\n private readonly keycloakStorageService: KeycloakStorageService\n ) {\n this.openTokenRefreshSubscription();\n this.openRefreshTokenSubscription();\n }\n\n ngOnDestroy(): void {\n this.tokenRefreshSubscription?.unsubscribe();\n this.refreshTokenSubscription?.unsubscribe();\n this.closeExpiryTimerSubscription();\n }\n\n init(): void {\n this.userIdentity = new ReplaySubject();\n this.keycloakService.loadUserProfile().then(user => {\n this.logger.debug('KeycloakUserService: loadUserProfile = ', user);\n const roles: Array<string> = [];\n this.keycloakService.getUserRoles(true).forEach(role => roles.push(role));\n const valtimoUserIdentity = new ValtimoUserIdentity(\n user.email,\n user.firstName,\n user.lastName,\n roles,\n user.username,\n user.id\n );\n this.logger.debug('KeycloakUserService: loaded user identity', valtimoUserIdentity);\n this.userIdentity.next(valtimoUserIdentity);\n });\n this.setRefreshToken();\n }\n\n getUserSubject(): ReplaySubject<UserIdentity> {\n this.logger.debug('KeycloakUserService: getUserIdentity');\n return this.userIdentity;\n }\n\n logout(): void {\n this.logger.debug('KeycloakUserService: logout');\n this.keycloakService.logout(this.keycloakOptionsService.logoutRedirectUri);\n }\n\n async getToken(): Promise<string> {\n this.logger.debug('KeycloakUserService: getToken');\n return this.keycloakService.getToken();\n }\n\n async updateToken(minValidity: number): Promise<boolean> {\n this.logger.debug('KeycloakUserService: updateToken');\n return this.keycloakService.updateToken(minValidity);\n }\n\n private openTokenRefreshSubscription(): void {\n this.tokenRefreshSubscription = this.keycloakService.keycloakEvents$.subscribe(\n keycloakEvent => {\n if (keycloakEvent.type === KeycloakEventTypeLegacy.OnAuthRefreshSuccess) {\n this.setRefreshToken();\n }\n }\n );\n }\n\n private get _expiryTimeMs() {\n return this._tokenExp - Date.now() - 1000;\n }\n\n private openRefreshTokenSubscription(): void {\n this.refreshTokenSubscription = this._refreshToken$.subscribe(refreshToken => {\n const decodedRefreshToken = jwtDecode(refreshToken);\n this._tokenExp = decodedRefreshToken.exp * 1000;\n\n this.closeExpiryTimerSubscription();\n this.openExpiryTimerSubscription();\n });\n }\n\n private setRefreshToken(): void {\n const refreshToken = this.keycloakService.getKeycloakInstance()?.refreshToken;\n if (refreshToken) this._refreshToken$.next(refreshToken);\n }\n\n private openExpiryTimerSubscription(): void {\n this.expiryTimerSubscription = timer(0, 1000)\n .pipe(\n switchMap(() => {\n if (this._expiryTimeMs <= this.FIVE_MINUTES_MS) {\n this._counter = new Date(0, 0, 0, 0, 0, 0);\n this._counter.setSeconds(this._expiryTimeMs / 1000);\n }\n\n return combineLatest([\n this.promptService.promptVisible$,\n this.translateService.stream('keycloak.expiryPromptTitle'),\n this.translateService.stream('keycloak.expiryPromptDescription', {\n expiryTime: this.datePipe.transform(this._counter, 'mm:ss'),\n }),\n this.translateService.stream('keycloak.expiryPromptCancel'),\n this.translateService.stream('keycloak.expiryPromptConfirm'),\n ]);\n })\n )\n .subscribe(([promptVisible, headerText, bodyText, cancelButtonText, confirmButtonText]) => {\n this.promptService.identifier$.pipe(take(1)).subscribe(identifier => {\n if (\n (!promptVisible || identifier !== this.EXPIRE_TOKEN_CONFIRMATION) &&\n this._expiryTimeMs <= this.FIVE_MINUTES_MS\n ) {\n this.openConfirmationPrompt(headerText, bodyText, cancelButtonText, confirmButtonText);\n }\n\n if (promptVisible && identifier === this.EXPIRE_TOKEN_CONFIRMATION) {\n this.promptService.setBodyText(bodyText);\n }\n });\n\n if (this._expiryTimeMs < 2000) {\n this.saveUrl();\n this.logout();\n }\n });\n }\n\n private closeExpiryTimerSubscription(): void {\n this.expiryTimerSubscription?.unsubscribe();\n }\n\n private openConfirmationPrompt(\n headerText: string,\n bodyText: string,\n cancelButtonText: string,\n confirmButtonText: string\n ): void {\n this.promptService.openPrompt({\n identifier: this.EXPIRE_TOKEN_CONFIRMATION,\n headerText,\n bodyText,\n cancelButtonText,\n confirmButtonText,\n closeOnConfirm: true,\n closeOnCancel: false,\n cancelCallbackFunction: () => {\n this.keycloakService.logout();\n },\n confirmCallBackFunction: () => {\n this.closeExpiryTimerSubscription();\n this.updateToken(20);\n },\n });\n }\n\n private saveUrl(): void {\n const returnToLastUrlAfterTokenExpiration =\n this.configService?.config?.featureToggles?.returnToLastUrlAfterTokenExpiration;\n\n if (returnToLastUrlAfterTokenExpiration) {\n sessionStorage.setItem(\n STORAGE_KEYS.urlBeforeExpiration,\n this.keycloakStorageService.getCurrentUrl()\n );\n sessionStorage.setItem(\n STORAGE_KEYS.urlBeforeExpirationParams,\n this.keycloakStorageService.getCurrentUrlParams()\n );\n }\n }\n}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './keycloak-auth-guard.service';\nexport * from './keycloak-options.service';\nexport * from './keycloak-user.service';\nexport * from './keycloak-storage.service';\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakOptionsService, KeycloakStorageService} from './services';\nimport {STORAGE_KEYS} from './constants';\n\n@Component({\n standalone: false,\n selector: 'valtimo-keycloak-callback',\n template: '',\n})\nexport class CallbackComponent {\n constructor(\n private router: Router,\n private keycloakOptionsService: KeycloakOptionsService,\n private logger: NGXLogger,\n private readonly keycloakStorageService: KeycloakStorageService\n ) {\n logger.debug('callback');\n const savedRedirectTo = window.sessionStorage.getItem(STORAGE_KEYS.redirectTo);\n const savedRedirectToParams = window.sessionStorage.getItem(STORAGE_KEYS.redirectToParams);\n const parsedSavedRedirectToParams =\n this.keycloakStorageService.parseSavedParams(savedRedirectToParams);\n\n const urlBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpiration);\n const paramsBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpirationParams);\n const parsedParamsBeforeExpiration =\n this.keycloakStorageService.parseSavedParams(paramsBeforeExpiration);\n\n let redirectTo!: string;\n\n if (savedRedirectTo) {\n redirectTo = savedRedirectTo;\n } else {\n redirectTo = '/';\n }\n\n logger.debug('keycloak callback redirect =', redirectTo);\n logger.debug('keycloak callback redirect params =', savedRedirectToParams);\n\n if (STORAGE_KEYS.urlBeforeExpiration in sessionStorage) {\n this.router.navigate([urlBeforeExpiration], {queryParams: parsedParamsBeforeExpiration});\n sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpiration);\n sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpirationParams);\n } else {\n this.router.navigate([redirectTo], {queryParams: parsedSavedRedirectToParams});\n }\n }\n}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CallbackComponent} from './callback.component';\nimport {CommonModule} from '@angular/common';\n\nconst routes: Routes = [\n {\n path: 'keycloak/callback',\n component: CallbackComponent,\n data: {title: 'Loading...'},\n },\n];\n\n@NgModule({\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class KeycloakRoutingModule {}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {KeycloakAngularModule} from 'keycloak-angular';\nimport {CallbackComponent} from './callback.component';\nimport {KeycloakRoutingModule} from './keycloak-routing.module';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\n\n@NgModule({\n declarations: [CallbackComponent],\n imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule],\n exports: [CallbackComponent],\n providers: [DatePipe],\n})\nexport class KeycloakModule {}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {KeycloakService} from 'keycloak-angular';\nimport {KeycloakOptionsService, KeycloakStorageService, KeycloakUserService} from './services';\nimport {Injector} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {STORAGE_KEYS} from './constants';\n\nexport function keycloakInitializer(injector: Injector): () => Promise<any> {\n const keycloakService = injector.get<KeycloakService>(KeycloakService);\n const keycloakUserService = injector.get<KeycloakUserService>(KeycloakUserService);\n const optionsService = injector.get<KeycloakOptionsService>(KeycloakOptionsService); // TODO possible removal of abstraction\n const storageService = injector.get<KeycloakStorageService>(KeycloakStorageService);\n const logger = injector.get<NGXLogger>(NGXLogger);\n\n return async (): Promise<any> => {\n try {\n logger.debug('Keycloak initializer before init');\n\n const keycloakOptions = optionsService.keycloakOptions;\n const currentUrl = window.location.href.split('#')[0];\n\n if (keycloakOptions.initOptions.redirectUri !== currentUrl) {\n const redirectTo = storageService.getCurrentUrl();\n logger.debug('Setting redirectTo =', redirectTo);\n window.sessionStorage.setItem(STORAGE_KEYS.redirectTo, redirectTo);\n window.sessionStorage.setItem(\n STORAGE_KEYS.redirectToParams,\n storageService.getCurrentUrlParams()\n );\n }\n\n const initResult = await keycloakService.init(keycloakOptions);\n logger.debug('Keycloak initializer after init');\n\n keycloakUserService.init();\n\n return initResult;\n } catch (error) {\n logger.debug('Keycloak initializer error', error);\n throw error;\n }\n };\n}\n","/*\n * Copyright 2015-2025 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of keycloak\n */\n\nexport * from './lib/models';\nexport * from './lib/keycloak.module';\nexport * from './lib/services/keycloak-auth-guard.service';\nexport * from './lib/services/keycloak-user.service';\nexport * from './lib/keycloak.init';\nexport * from './lib/services/keycloak-options.service';\nexport * from './lib/callback.component';\nexport * from './lib/constants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i2.KeycloakOptionsService","i7","i8","i9.KeycloakStorageService","i2.KeycloakStorageService"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;AAEH,MAAM,YAAY,GAAG;AACnB,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,yBAAyB,EAAE,2BAA2B;AACtD,IAAA,UAAU,EAAE,Y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AAC,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC;AAClE,gBAAA,MAAM,CAAC,cAAc,CAAC,OAAO,CAC3B,YAAY,CAAC,gBAAgB,EAC7B,cAAc,CAAC,mBAAmB,EAAE,CACrC;;YAGH,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC;AAC9D,YAAA,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC;YAE/C,mBAAmB,CAAC,IAAI,EAAE;AAE1B,YAAA,OAAO,UAAU;;QACjB,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC;AACjD,YAAA,MAAM,KAAK;;AAEf,KAAC;AACH;;ACzDA;;;;;;;;;;;;;;AAcG;AAEH;;AAEG;;AClBH;;AAEG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.component.d.ts","sourceRoot":"","sources":["../../../../projects/valtimo/keycloak/src/lib/callback.component.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAE,sBAAsB,EAAC,MAAM,YAAY,CAAC;;AAG1E,
|
|
1
|
+
{"version":3,"file":"callback.component.d.ts","sourceRoot":"","sources":["../../../../projects/valtimo/keycloak/src/lib/callback.component.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAE,sBAAsB,EAAC,MAAM,YAAY,CAAC;;AAG1E,qBAKa,iBAAiB;IAE1B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,sBAAsB;IAC9B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ,CAAC,sBAAsB;gBAH/B,MAAM,EAAE,MAAM,EACd,sBAAsB,EAAE,sBAAsB,EAC9C,MAAM,EAAE,SAAS,EACR,sBAAsB,EAAE,sBAAsB;yCALtD,iBAAiB;2CAAjB,iBAAiB;CAqC7B"}
|
|
@@ -2,7 +2,7 @@ import { OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { ReplaySubject } from 'rxjs';
|
|
3
3
|
import { NGXLogger } from 'ngx-logger';
|
|
4
4
|
import { KeycloakService } from 'keycloak-angular';
|
|
5
|
-
import { ConfigService, UserIdentity, UserService } from '@valtimo/
|
|
5
|
+
import { ConfigService, UserIdentity, UserService } from '@valtimo/shared';
|
|
6
6
|
import { KeycloakOptionsService } from './keycloak-options.service';
|
|
7
7
|
import { TranslateService } from '@ngx-translate/core';
|
|
8
8
|
import { DatePipe } from '@angular/common';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keycloak-user.service.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/keycloak/src/lib/services/keycloak-user.service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAa,SAAS,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"keycloak-user.service.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/keycloak/src/lib/services/keycloak-user.service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAa,SAAS,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAgB,aAAa,EAA0C,MAAM,MAAM,CAAC;AAC3F,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAA0B,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO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IAAI,aAAa,CAAC,YAAY,CAAC;IAK7C,MAAM,IAAI,IAAI;IAKR,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAK3B,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxD,OAAO,CAAC,4BAA4B;IAUpC,OAAO,KAAK,aAAa,GAExB;IAED,OAAO,CAAC,4BAA4B;IAUpC,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,2BAA2B;IAyCnC,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,sBAAsB;IAwB9B,OAAO,CAAC,OAAO;yCA/KJ,mBAAmB;6CAAnB,mBAAmB;CA8L/B"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valtimo/keycloak",
|
|
3
3
|
"license": "EUPL-1.2",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "13.0.1-next-minor.81",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@angular/common": "^
|
|
7
|
-
"@angular/core": "^
|
|
6
|
+
"@angular/common": "^19.2.8",
|
|
7
|
+
"@angular/core": "^19.2.8"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"jwt-decode": "4.0.0",
|
|
11
|
-
"keycloak-angular": "
|
|
12
|
-
"keycloak-js": "
|
|
13
|
-
"tslib": "2.
|
|
11
|
+
"keycloak-angular": "19.0.2",
|
|
12
|
+
"keycloak-js": "26.1.5",
|
|
13
|
+
"tslib": "2.8.1"
|
|
14
14
|
},
|
|
15
15
|
"module": "fesm2022/valtimo-keycloak.mjs",
|
|
16
16
|
"typings": "index.d.ts",
|
|
@@ -20,8 +20,6 @@
|
|
|
20
20
|
},
|
|
21
21
|
".": {
|
|
22
22
|
"types": "./index.d.ts",
|
|
23
|
-
"esm2022": "./esm2022/valtimo-keycloak.mjs",
|
|
24
|
-
"esm": "./esm2022/valtimo-keycloak.mjs",
|
|
25
23
|
"default": "./fesm2022/valtimo-keycloak.mjs"
|
|
26
24
|
}
|
|
27
25
|
},
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2015-2024 Ritense BV, the Netherlands.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under EUPL, Version 1.2 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" basis,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
import { Component } from '@angular/core';
|
|
17
|
-
import { STORAGE_KEYS } from './constants';
|
|
18
|
-
import * as i0 from "@angular/core";
|
|
19
|
-
import * as i1 from "@angular/router";
|
|
20
|
-
import * as i2 from "./services";
|
|
21
|
-
import * as i3 from "ngx-logger";
|
|
22
|
-
export class CallbackComponent {
|
|
23
|
-
constructor(router, keycloakOptionsService, logger, keycloakStorageService) {
|
|
24
|
-
this.router = router;
|
|
25
|
-
this.keycloakOptionsService = keycloakOptionsService;
|
|
26
|
-
this.logger = logger;
|
|
27
|
-
this.keycloakStorageService = keycloakStorageService;
|
|
28
|
-
logger.debug('callback');
|
|
29
|
-
const savedRedirectTo = window.sessionStorage.getItem(STORAGE_KEYS.redirectTo);
|
|
30
|
-
const savedRedirectToParams = window.sessionStorage.getItem(STORAGE_KEYS.redirectToParams);
|
|
31
|
-
const parsedSavedRedirectToParams = this.keycloakStorageService.parseSavedParams(savedRedirectToParams);
|
|
32
|
-
const urlBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpiration);
|
|
33
|
-
const paramsBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpirationParams);
|
|
34
|
-
const parsedParamsBeforeExpiration = this.keycloakStorageService.parseSavedParams(paramsBeforeExpiration);
|
|
35
|
-
let redirectTo;
|
|
36
|
-
if (savedRedirectTo) {
|
|
37
|
-
redirectTo = savedRedirectTo;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
redirectTo = '/';
|
|
41
|
-
}
|
|
42
|
-
logger.debug('keycloak callback redirect =', redirectTo);
|
|
43
|
-
logger.debug('keycloak callback redirect params =', savedRedirectToParams);
|
|
44
|
-
if (STORAGE_KEYS.urlBeforeExpiration in sessionStorage) {
|
|
45
|
-
this.router.navigate([urlBeforeExpiration], { queryParams: parsedParamsBeforeExpiration });
|
|
46
|
-
sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpiration);
|
|
47
|
-
sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpirationParams);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
this.router.navigate([redirectTo], { queryParams: parsedSavedRedirectToParams });
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CallbackComponent, deps: [{ token: i1.Router }, { token: i2.KeycloakOptionsService }, { token: i3.NGXLogger }, { token: i2.KeycloakStorageService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
54
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CallbackComponent, selector: "valtimo-keycloak-callback", ngImport: i0, template: '', isInline: true }); }
|
|
55
|
-
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CallbackComponent, decorators: [{
|
|
57
|
-
type: Component,
|
|
58
|
-
args: [{
|
|
59
|
-
selector: 'valtimo-keycloak-callback',
|
|
60
|
-
template: '',
|
|
61
|
-
}]
|
|
62
|
-
}], ctorParameters: () => [{ type: i1.Router }, { type: i2.KeycloakOptionsService }, { type: i3.NGXLogger }, { type: i2.KeycloakStorageService }] });
|
|
63
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsbGJhY2suY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdmFsdGltby9rZXljbG9hay9zcmMvbGliL2NhbGxiYWNrLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7R0FjRztBQUVILE9BQU8sRUFBQyxTQUFTLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFJeEMsT0FBTyxFQUFDLFlBQVksRUFBQyxNQUFNLGFBQWEsQ0FBQzs7Ozs7QUFNekMsTUFBTSxPQUFPLGlCQUFpQjtJQUM1QixZQUNVLE1BQWMsRUFDZCxzQkFBOEMsRUFDOUMsTUFBaUIsRUFDUixzQkFBOEM7UUFIdkQsV0FBTSxHQUFOLE1BQU0sQ0FBUTtRQUNkLDJCQUFzQixHQUF0QixzQkFBc0IsQ0FBd0I7UUFDOUMsV0FBTSxHQUFOLE1BQU0sQ0FBVztRQUNSLDJCQUFzQixHQUF0QixzQkFBc0IsQ0FBd0I7UUFFL0QsTUFBTSxDQUFDLEtBQUssQ0FBQyxVQUFVLENBQUMsQ0FBQztRQUN6QixNQUFNLGVBQWUsR0FBRyxNQUFNLENBQUMsY0FBYyxDQUFDLE9BQU8sQ0FBQyxZQUFZLENBQUMsVUFBVSxDQUFDLENBQUM7UUFDL0UsTUFBTSxxQkFBcUIsR0FBRyxNQUFNLENBQUMsY0FBYyxDQUFDLE9BQU8sQ0FBQyxZQUFZLENBQUMsZ0JBQWdCLENBQUMsQ0FBQztRQUMzRixNQUFNLDJCQUEyQixHQUMvQixJQUFJLENBQUMsc0J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