@valtimo/keycloak 5.14.0 → 10.0.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/esm2020/lib/callback.component.mjs +3 -3
- package/esm2020/lib/keycloak-auth-guard.service.mjs +3 -3
- package/esm2020/lib/keycloak-options.service.mjs +3 -3
- package/esm2020/lib/keycloak-routing.module.mjs +5 -5
- package/esm2020/lib/keycloak-user.service.mjs +3 -3
- package/esm2020/lib/keycloak.module.mjs +5 -5
- package/fesm2015/valtimo-keycloak.mjs +20 -20
- package/fesm2015/valtimo-keycloak.mjs.map +1 -1
- package/fesm2020/valtimo-keycloak.mjs +20 -20
- package/fesm2020/valtimo-keycloak.mjs.map +1 -1
- package/{valtimo-keycloak.d.ts → index.d.ts} +0 -0
- package/lib/callback.component.d.ts +1 -1
- package/package.json +7 -7
|
@@ -45,9 +45,9 @@ export class CallbackComponent {
|
|
|
45
45
|
this.router.navigate([redirectTo], { queryParams: redirectToParams || {} });
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
CallbackComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
49
|
-
CallbackComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
48
|
+
CallbackComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CallbackComponent, deps: [{ token: i1.Router }, { token: i2.KeycloakOptionsService }, { token: i3.NGXLogger }], target: i0.ɵɵFactoryTarget.Component });
|
|
49
|
+
CallbackComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CallbackComponent, selector: "valtimo-keycloak-callback", ngImport: i0, template: '', isInline: true });
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CallbackComponent, decorators: [{
|
|
51
51
|
type: Component,
|
|
52
52
|
args: [{
|
|
53
53
|
selector: 'valtimo-keycloak-callback',
|
|
@@ -50,9 +50,9 @@ export class KeycloakAuthGuardService extends KeycloakAuthGuard {
|
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
KeycloakAuthGuardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
54
|
-
KeycloakAuthGuardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
53
|
+
KeycloakAuthGuardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakAuthGuardService, deps: [{ token: i1.Router }, { token: i2.KeycloakService }, { token: i3.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
54
|
+
KeycloakAuthGuardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakAuthGuardService, providedIn: 'root' });
|
|
55
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakAuthGuardService, decorators: [{
|
|
56
56
|
type: Injectable,
|
|
57
57
|
args: [{
|
|
58
58
|
providedIn: 'root',
|
|
@@ -13,9 +13,9 @@ export class KeycloakOptionsService {
|
|
|
13
13
|
return this.valtimoKeycloakOptions.logoutRedirectUri;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
KeycloakOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
17
|
-
KeycloakOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
16
|
+
KeycloakOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakOptionsService, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
17
|
+
KeycloakOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakOptionsService, providedIn: 'root' });
|
|
18
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakOptionsService, decorators: [{
|
|
19
19
|
type: Injectable,
|
|
20
20
|
args: [{
|
|
21
21
|
providedIn: 'root',
|
|
@@ -28,14 +28,14 @@ const routes = [
|
|
|
28
28
|
];
|
|
29
29
|
export class KeycloakRoutingModule {
|
|
30
30
|
}
|
|
31
|
-
KeycloakRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
32
|
-
KeycloakRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
33
|
-
KeycloakRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
31
|
+
KeycloakRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
32
|
+
KeycloakRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, imports: [CommonModule, i1.RouterModule], exports: [RouterModule] });
|
|
33
|
+
KeycloakRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] });
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, decorators: [{
|
|
35
35
|
type: NgModule,
|
|
36
36
|
args: [{
|
|
37
37
|
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
38
38
|
exports: [RouterModule],
|
|
39
39
|
}]
|
|
40
40
|
}] });
|
|
41
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5Y2xvYWstcm91dGluZy5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy92YWx0aW1vL2tleWNsb2FrL3NyYy9saWIva2V5Y2xvYWstcm91dGluZy5tb2R1bGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7O0dBY0c7QUFFSCxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQ3ZDLE9BQU8sRUFBQyxZQUFZLEVBQVMsTUFBTSxpQkFBaUIsQ0FBQztBQUNyRCxPQUFPLEVBQUMsaUJBQWlCLEVBQUMsTUFBTSxzQkFBc0IsQ0FBQztBQUN2RCxPQUFPLEVBQUMsWUFBWSxFQUFDLE1BQU0saUJBQWlCLENBQUM7OztBQUU3QyxNQUFNLE1BQU0sR0FBVztJQUNyQjtRQUNFLElBQUksRUFBRSxtQkFBbUI7UUFDekIsU0FBUyxFQUFFLGlCQUFpQjtRQUM1QixJQUFJLEVBQUUsRUFBQyxLQUFLLEVBQUUsWUFBWSxFQUFDO0tBQzVCO0NBQ0YsQ0FBQztBQU1GLE1BQU0sT0FBTyxxQkFBcUI7O21IQUFyQixxQkFBcUI7b0hBQXJCLHFCQUFxQixZQUh0QixZQUFZLDhCQUNaLFlBQVk7b0hBRVgscUJBQXFCLFlBSHRCLFlBQVksRUFBRSxZQUFZLENBQUMsU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0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLlxuICovXG5cbmltcG9ydCB7TmdNb2R1bGV9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHtSb3V0ZXJNb2R1bGUsIFJvdXRlc30gZnJvbSAnQGFuZ3VsYXIvcm91dGVyJztcbmltcG9ydCB7Q2FsbGJhY2tDb21wb25lbnR9IGZyb20gJy4vY2FsbGJhY2suY29tcG9uZW50JztcbmltcG9ydCB7Q29tbW9uTW9kdWxlfSBmcm9tICdAYW5ndWxhci9jb21tb24nO1xuXG5jb25zdCByb3V0ZXM6IFJvdXRlcyA9IFtcbiAge1xuICAgIHBhdGg6ICdrZXljbG9hay9jYWxsYmFjaycsXG4gICAgY29tcG9uZW50OiBDYWxsYmFja0NvbXBvbmVudCxcbiAgICBkYXRhOiB7dGl0bGU6ICdMb2FkaW5nLi4uJ30sXG4gIH0sXG5dO1xuXG5ATmdNb2R1bGUoe1xuICBpbXBvcnRzOiBbQ29tbW9uTW9kdWxlLCBSb3V0ZXJNb2R1bGUuZm9yQ2hpbGQocm91dGVzKV0sXG4gIGV4cG9ydHM6IFtSb3V0ZXJNb2R1bGVdLFxufSlcbmV4cG9ydCBjbGFzcyBLZXljbG9ha1JvdXRpbmdNb2R1bGUge31cbiJdfQ==
|
|
@@ -151,9 +151,9 @@ export class KeycloakUserService {
|
|
|
151
151
|
this.expiryTimerSubscription?.unsubscribe();
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
KeycloakUserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
155
|
-
KeycloakUserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
156
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
154
|
+
KeycloakUserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakUserService, deps: [{ token: i1.KeycloakService }, { token: i2.KeycloakOptionsService }, { token: i3.NGXLogger }, { token: i4.PromptService }, { token: i5.TranslateService }, { token: i6.DatePipe }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
155
|
+
KeycloakUserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakUserService, providedIn: 'root' });
|
|
156
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakUserService, decorators: [{
|
|
157
157
|
type: Injectable,
|
|
158
158
|
args: [{
|
|
159
159
|
providedIn: 'root',
|
|
@@ -22,10 +22,10 @@ import { DatePipe } from '@angular/common';
|
|
|
22
22
|
import * as i0 from "@angular/core";
|
|
23
23
|
export class KeycloakModule {
|
|
24
24
|
}
|
|
25
|
-
KeycloakModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
26
|
-
KeycloakModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
27
|
-
KeycloakModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
25
|
+
KeycloakModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
26
|
+
KeycloakModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, declarations: [CallbackComponent], imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule], exports: [CallbackComponent] });
|
|
27
|
+
KeycloakModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, providers: [DatePipe], imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule] });
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, decorators: [{
|
|
29
29
|
type: NgModule,
|
|
30
30
|
args: [{
|
|
31
31
|
declarations: [CallbackComponent],
|
|
@@ -34,4 +34,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
34
34
|
providers: [DatePipe],
|
|
35
35
|
}]
|
|
36
36
|
}] });
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5Y2xvYWsubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdmFsdGltby9rZXljbG9hay9zcmMvbGliL2tleWNsb2FrLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7R0FjRztBQUVILE9BQU8sRUFBQyxRQUFRLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDdkMsT0FBTyxFQUFDLHFCQUFxQixFQUFDLE1BQU0sa0JBQWtCLENBQUM7QUFDdkQsT0FBTyxFQUFDLGlCQUFpQixFQUFDLE1BQU0sc0JBQXNCLENBQUM7QUFDdkQsT0FBTyxFQUFDLHFCQUFxQixFQUFDLE1BQU0sMkJBQTJCLENBQUM7QUFDaEUsT0FBTyxFQUFDLGVBQWUsRUFBQyxNQUFNLHFCQUFxQixDQUFDO0FBQ3BELE9BQU8sRUFBQyxRQUFRLEVBQUMsTUFBTSxpQkFBaUIsQ0FBQzs7QUFRekMsTUFBTSxPQUFPLGNBQWM7OzRHQUFkLGNBQWM7NkdBQWQsY0FBYyxpQkFMVixpQkFBaUIsYUFDdEIscUJBQXFCLEVBQUUscUJBQXFCLEVBQUUsZUFBZSxhQUM3RCxpQkFBaUI7Nkd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GxpZWQuXG4gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kXG4gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS5cbiAqL1xuXG5pbXBvcnQge05nTW9kdWxlfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB7S2V5Y2xvYWtBbmd1bGFyTW9kdWxlfSBmcm9tICdrZXljbG9hay1hbmd1bGFyJztcbmltcG9ydCB7Q2FsbGJhY2tDb21wb25lbnR9IGZyb20gJy4vY2FsbGJhY2suY29tcG9uZW50JztcbmltcG9ydCB7S2V5Y2xvYWtSb3V0aW5nTW9kdWxlfSBmcm9tICcuL2tleWNsb2FrLXJvdXRpbmcubW9kdWxlJztcbmltcG9ydCB7VHJhbnNsYXRlTW9kdWxlfSBmcm9tICdAbmd4LXRyYW5zbGF0ZS9jb3JlJztcbmltcG9ydCB7RGF0ZVBpcGV9IGZyb20gJ0Bhbmd1bGFyL2NvbW1vbic7XG5cbkBOZ01vZHVsZSh7XG4gIGRlY2xhcmF0aW9uczogW0NhbGxiYWNrQ29tcG9uZW50XSxcbiAgaW1wb3J0czogW0tleWNsb2FrUm91dGluZ01vZHVsZSwgS2V5Y2xvYWtBbmd1bGFyTW9kdWxlLCBUcmFuc2xhdGVNb2R1bGVdLFxuICBleHBvcnRzOiBbQ2FsbGJhY2tDb21wb25lbnRdLFxuICBwcm92aWRlcnM6IFtEYXRlUGlwZV0sXG59KVxuZXhwb3J0IGNsYXNzIEtleWNsb2FrTW9kdWxlIHt9XG4iXX0=
|
|
@@ -46,9 +46,9 @@ class KeycloakOptionsService {
|
|
|
46
46
|
return this.valtimoKeycloakOptions.logoutRedirectUri;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
KeycloakOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
50
|
-
KeycloakOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
49
|
+
KeycloakOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakOptionsService, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
50
|
+
KeycloakOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakOptionsService, providedIn: 'root' });
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakOptionsService, decorators: [{
|
|
52
52
|
type: Injectable,
|
|
53
53
|
args: [{
|
|
54
54
|
providedIn: 'root',
|
|
@@ -97,9 +97,9 @@ class CallbackComponent {
|
|
|
97
97
|
this.router.navigate([redirectTo], { queryParams: redirectToParams || {} });
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
CallbackComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
101
|
-
CallbackComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
102
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
100
|
+
CallbackComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CallbackComponent, deps: [{ token: i1$1.Router }, { token: KeycloakOptionsService }, { token: i3.NGXLogger }], target: i0.ɵɵFactoryTarget.Component });
|
|
101
|
+
CallbackComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CallbackComponent, selector: "valtimo-keycloak-callback", ngImport: i0, template: '', isInline: true });
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CallbackComponent, decorators: [{
|
|
103
103
|
type: Component,
|
|
104
104
|
args: [{
|
|
105
105
|
selector: 'valtimo-keycloak-callback',
|
|
@@ -131,10 +131,10 @@ const routes = [
|
|
|
131
131
|
];
|
|
132
132
|
class KeycloakRoutingModule {
|
|
133
133
|
}
|
|
134
|
-
KeycloakRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
135
|
-
KeycloakRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
136
|
-
KeycloakRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
137
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
134
|
+
KeycloakRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
135
|
+
KeycloakRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, imports: [CommonModule, i1$1.RouterModule], exports: [RouterModule] });
|
|
136
|
+
KeycloakRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] });
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, decorators: [{
|
|
138
138
|
type: NgModule,
|
|
139
139
|
args: [{
|
|
140
140
|
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
@@ -159,10 +159,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
159
159
|
*/
|
|
160
160
|
class KeycloakModule {
|
|
161
161
|
}
|
|
162
|
-
KeycloakModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
163
|
-
KeycloakModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
164
|
-
KeycloakModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
162
|
+
KeycloakModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
163
|
+
KeycloakModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, declarations: [CallbackComponent], imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule], exports: [CallbackComponent] });
|
|
164
|
+
KeycloakModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, providers: [DatePipe], imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule] });
|
|
165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, decorators: [{
|
|
166
166
|
type: NgModule,
|
|
167
167
|
args: [{
|
|
168
168
|
declarations: [CallbackComponent],
|
|
@@ -218,9 +218,9 @@ class KeycloakAuthGuardService extends KeycloakAuthGuard {
|
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
|
-
KeycloakAuthGuardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
222
|
-
KeycloakAuthGuardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
223
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
221
|
+
KeycloakAuthGuardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakAuthGuardService, deps: [{ token: i1$1.Router }, { token: i2.KeycloakService }, { token: i3.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
222
|
+
KeycloakAuthGuardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakAuthGuardService, providedIn: 'root' });
|
|
223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakAuthGuardService, decorators: [{
|
|
224
224
|
type: Injectable,
|
|
225
225
|
args: [{
|
|
226
226
|
providedIn: 'root',
|
|
@@ -359,9 +359,9 @@ class KeycloakUserService {
|
|
|
359
359
|
(_a = this.expiryTimerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
KeycloakUserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
363
|
-
KeycloakUserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
364
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
362
|
+
KeycloakUserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakUserService, deps: [{ token: i2.KeycloakService }, { token: KeycloakOptionsService }, { token: i3.NGXLogger }, { token: i4.PromptService }, { token: i5.TranslateService }, { token: i6.DatePipe }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
363
|
+
KeycloakUserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakUserService, providedIn: 'root' });
|
|
364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakUserService, decorators: [{
|
|
365
365
|
type: Injectable,
|
|
366
366
|
args: [{
|
|
367
367
|
providedIn: 'root',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valtimo-keycloak.mjs","sources":["../../../../projects/valtimo/keycloak/src/lib/models/index.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-options.service.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-auth-guard.service.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-user.service.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-2020 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-2020 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-2020 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} from './keycloak-options.service';\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 ) {\n logger.debug('callback');\n const savedRedirectTo = window.sessionStorage.getItem('redirectTo');\n const savedRedirectToParams = window.sessionStorage.getItem('redirectToParams');\n const parsedSavedRedirectToParams =\n typeof savedRedirectToParams === 'string' &&\n savedRedirectToParams.length > 2 &&\n JSON.parse(savedRedirectToParams);\n let redirectTo!: string;\n let redirectToParams!: object;\n\n if (savedRedirectTo) {\n redirectTo = savedRedirectTo;\n } else {\n redirectTo = '/';\n }\n\n if (savedRedirectToParams && parsedSavedRedirectToParams) {\n redirectToParams = parsedSavedRedirectToParams;\n }\n\n logger.debug('keycloak callback redirect =', redirectTo);\n logger.debug('keycloak callback redirect params =', savedRedirectToParams);\n\n this.router.navigate([redirectTo], {queryParams: redirectToParams || {}});\n }\n}\n","/*\n * Copyright 2015-2020 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-2020 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-2020 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 if (!requiredRoles || requiredRoles.length === 0) {\n return resolve(true);\n } else {\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","/*\n * Copyright 2015-2020 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 {UserIdentity, UserService, ValtimoUserIdentity} from '@valtimo/config';\nimport {KeycloakOptionsService} from './keycloak-options.service';\nimport jwt_decode from 'jwt-decode';\nimport {PromptService} from '@valtimo/user-interface';\nimport {TranslateService} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\nimport {take} from 'rxjs/operators';\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 _expiryTimeMs!: 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 ) {\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 );\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 openRefreshTokenSubscription(): void {\n this.refreshTokenSubscription = this._refreshToken$.subscribe(refreshToken => {\n const decodedRefreshToken: any = jwt_decode(refreshToken);\n const tokenExp = decodedRefreshToken.exp * 1000;\n const expiryTimeMs = tokenExp - Date.now() - 1000;\n\n this._expiryTimeMs = expiryTimeMs;\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 map(() => {\n this._expiryTimeMs = this._expiryTimeMs - 1000;\n return this._expiryTimeMs;\n }),\n switchMap(expiryTimeMs => {\n if (expiryTimeMs <= this.FIVE_MINUTES_MS) {\n this._counter = new Date(0, 0, 0, 0, 0, 0);\n this._counter.setSeconds(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.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 if (promptVisible && identifier === this.EXPIRE_TOKEN_CONFIRMATION) {\n this.promptService.setBodyText(bodyText);\n }\n });\n\n if (this._expiryTimeMs < 2000) {\n this.logout();\n }\n });\n }\n\n private closeExpiryTimerSubscription(): void {\n this.expiryTimerSubscription?.unsubscribe();\n }\n}\n","/*\n * Copyright 2015-2020 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} from './keycloak-options.service';\nimport {Injector} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakUserService} from './keycloak-user.service';\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 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 = window.location.pathname;\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n logger.debug('Setting redirectTo =', redirectTo);\n window.sessionStorage.setItem('redirectTo', redirectTo);\n window.sessionStorage.setItem('redirectToParams', JSON.stringify(params));\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-2020 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/keycloak-auth-guard.service';\nexport * from './lib/keycloak-user.service';\nexport * from './lib/keycloak.init';\nexport * from './lib/keycloak-options.service';\nexport * from './lib/callback.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n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DA;;;;;;;;;;;;;;AAcG;;ACdH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"valtimo-keycloak.mjs","sources":["../../../../projects/valtimo/keycloak/src/lib/models/index.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-options.service.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-auth-guard.service.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-user.service.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-2020 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-2020 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-2020 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} from './keycloak-options.service';\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 ) {\n logger.debug('callback');\n const savedRedirectTo = window.sessionStorage.getItem('redirectTo');\n const savedRedirectToParams = window.sessionStorage.getItem('redirectToParams');\n const parsedSavedRedirectToParams =\n typeof savedRedirectToParams === 'string' &&\n savedRedirectToParams.length > 2 &&\n JSON.parse(savedRedirectToParams);\n let redirectTo!: string;\n let redirectToParams!: object;\n\n if (savedRedirectTo) {\n redirectTo = savedRedirectTo;\n } else {\n redirectTo = '/';\n }\n\n if (savedRedirectToParams && parsedSavedRedirectToParams) {\n redirectToParams = parsedSavedRedirectToParams;\n }\n\n logger.debug('keycloak callback redirect =', redirectTo);\n logger.debug('keycloak callback redirect params =', savedRedirectToParams);\n\n this.router.navigate([redirectTo], {queryParams: redirectToParams || {}});\n }\n}\n","/*\n * Copyright 2015-2020 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-2020 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-2020 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 if (!requiredRoles || requiredRoles.length === 0) {\n return resolve(true);\n } else {\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","/*\n * Copyright 2015-2020 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 {UserIdentity, UserService, ValtimoUserIdentity} from '@valtimo/config';\nimport {KeycloakOptionsService} from './keycloak-options.service';\nimport jwt_decode from 'jwt-decode';\nimport {PromptService} from '@valtimo/user-interface';\nimport {TranslateService} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\nimport {take} from 'rxjs/operators';\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 _expiryTimeMs!: 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 ) {\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 );\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 openRefreshTokenSubscription(): void {\n this.refreshTokenSubscription = this._refreshToken$.subscribe(refreshToken => {\n const decodedRefreshToken: any = jwt_decode(refreshToken);\n const tokenExp = decodedRefreshToken.exp * 1000;\n const expiryTimeMs = tokenExp - Date.now() - 1000;\n\n this._expiryTimeMs = expiryTimeMs;\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 map(() => {\n this._expiryTimeMs = this._expiryTimeMs - 1000;\n return this._expiryTimeMs;\n }),\n switchMap(expiryTimeMs => {\n if (expiryTimeMs <= this.FIVE_MINUTES_MS) {\n this._counter = new Date(0, 0, 0, 0, 0, 0);\n this._counter.setSeconds(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.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 if (promptVisible && identifier === this.EXPIRE_TOKEN_CONFIRMATION) {\n this.promptService.setBodyText(bodyText);\n }\n });\n\n if (this._expiryTimeMs < 2000) {\n this.logout();\n }\n });\n }\n\n private closeExpiryTimerSubscription(): void {\n this.expiryTimerSubscription?.unsubscribe();\n }\n}\n","/*\n * Copyright 2015-2020 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} from './keycloak-options.service';\nimport {Injector} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakUserService} from './keycloak-user.service';\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 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 = window.location.pathname;\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n logger.debug('Setting redirectTo =', redirectTo);\n window.sessionStorage.setItem('redirectTo', redirectTo);\n window.sessionStorage.setItem('redirectToParams', JSON.stringify(params));\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-2020 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/keycloak-auth-guard.service';\nexport * from './lib/keycloak-user.service';\nexport * from './lib/keycloak.init';\nexport * from './lib/keycloak-options.service';\nexport * from './lib/callback.component';\n","/**\n * Generated bundle index. Do not edit.\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loakOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
65
|
-
KeycloakOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
66
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
64
|
+
KeycloakOptionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakOptionsService, deps: [{ token: i1.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
65
|
+
KeycloakOptionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakOptionsService, providedIn: 'root' });
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakOptionsService, decorators: [{
|
|
67
67
|
type: Injectable,
|
|
68
68
|
args: [{
|
|
69
69
|
providedIn: 'root',
|
|
@@ -112,9 +112,9 @@ class CallbackComponent {
|
|
|
112
112
|
this.router.navigate([redirectTo], { queryParams: redirectToParams || {} });
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
CallbackComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
116
|
-
CallbackComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
115
|
+
CallbackComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CallbackComponent, deps: [{ token: i1$1.Router }, { token: KeycloakOptionsService }, { token: i3.NGXLogger }], target: i0.ɵɵFactoryTarget.Component });
|
|
116
|
+
CallbackComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: CallbackComponent, selector: "valtimo-keycloak-callback", ngImport: i0, template: '', isInline: true });
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: CallbackComponent, decorators: [{
|
|
118
118
|
type: Component,
|
|
119
119
|
args: [{
|
|
120
120
|
selector: 'valtimo-keycloak-callback',
|
|
@@ -146,10 +146,10 @@ const routes = [
|
|
|
146
146
|
];
|
|
147
147
|
class KeycloakRoutingModule {
|
|
148
148
|
}
|
|
149
|
-
KeycloakRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
150
|
-
KeycloakRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
151
|
-
KeycloakRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
152
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
149
|
+
KeycloakRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
150
|
+
KeycloakRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, imports: [CommonModule, i1$1.RouterModule], exports: [RouterModule] });
|
|
151
|
+
KeycloakRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, imports: [CommonModule, RouterModule.forChild(routes), RouterModule] });
|
|
152
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakRoutingModule, decorators: [{
|
|
153
153
|
type: NgModule,
|
|
154
154
|
args: [{
|
|
155
155
|
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
@@ -174,10 +174,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
174
174
|
*/
|
|
175
175
|
class KeycloakModule {
|
|
176
176
|
}
|
|
177
|
-
KeycloakModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
178
|
-
KeycloakModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "
|
|
179
|
-
KeycloakModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
177
|
+
KeycloakModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
178
|
+
KeycloakModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, declarations: [CallbackComponent], imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule], exports: [CallbackComponent] });
|
|
179
|
+
KeycloakModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, providers: [DatePipe], imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule] });
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakModule, decorators: [{
|
|
181
181
|
type: NgModule,
|
|
182
182
|
args: [{
|
|
183
183
|
declarations: [CallbackComponent],
|
|
@@ -233,9 +233,9 @@ class KeycloakAuthGuardService extends KeycloakAuthGuard {
|
|
|
233
233
|
});
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
KeycloakAuthGuardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
237
|
-
KeycloakAuthGuardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
236
|
+
KeycloakAuthGuardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakAuthGuardService, deps: [{ token: i1$1.Router }, { token: i2.KeycloakService }, { token: i3.NGXLogger }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
237
|
+
KeycloakAuthGuardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakAuthGuardService, providedIn: 'root' });
|
|
238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakAuthGuardService, decorators: [{
|
|
239
239
|
type: Injectable,
|
|
240
240
|
args: [{
|
|
241
241
|
providedIn: 'root',
|
|
@@ -382,9 +382,9 @@ class KeycloakUserService {
|
|
|
382
382
|
this.expiryTimerSubscription?.unsubscribe();
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
KeycloakUserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
386
|
-
KeycloakUserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
387
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
385
|
+
KeycloakUserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakUserService, deps: [{ token: i2.KeycloakService }, { token: KeycloakOptionsService }, { token: i3.NGXLogger }, { token: i4.PromptService }, { token: i5.TranslateService }, { token: i6.DatePipe }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
386
|
+
KeycloakUserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakUserService, providedIn: 'root' });
|
|
387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: KeycloakUserService, decorators: [{
|
|
388
388
|
type: Injectable,
|
|
389
389
|
args: [{
|
|
390
390
|
providedIn: 'root',
|
|
@@ -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/keycloak-options.service.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-auth-guard.service.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-user.service.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-2020 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-2020 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-2020 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-2020 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} from './keycloak-options.service';\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 ) {\n logger.debug('callback');\n const savedRedirectTo = window.sessionStorage.getItem('redirectTo');\n const savedRedirectToParams = window.sessionStorage.getItem('redirectToParams');\n const parsedSavedRedirectToParams =\n typeof savedRedirectToParams === 'string' &&\n savedRedirectToParams.length > 2 &&\n JSON.parse(savedRedirectToParams);\n let redirectTo!: string;\n let redirectToParams!: object;\n\n if (savedRedirectTo) {\n redirectTo = savedRedirectTo;\n } else {\n redirectTo = '/';\n }\n\n if (savedRedirectToParams && parsedSavedRedirectToParams) {\n redirectToParams = parsedSavedRedirectToParams;\n }\n\n logger.debug('keycloak callback redirect =', redirectTo);\n logger.debug('keycloak callback redirect params =', savedRedirectToParams);\n\n this.router.navigate([redirectTo], {queryParams: redirectToParams || {}});\n }\n}\n","/*\n * Copyright 2015-2020 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-2020 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-2020 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 if (!requiredRoles || requiredRoles.length === 0) {\n return resolve(true);\n } else {\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","/*\n * Copyright 2015-2020 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 {UserIdentity, UserService, ValtimoUserIdentity} from '@valtimo/config';\nimport {KeycloakOptionsService} from './keycloak-options.service';\nimport jwt_decode from 'jwt-decode';\nimport {PromptService} from '@valtimo/user-interface';\nimport {TranslateService} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\nimport {take} from 'rxjs/operators';\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 _expiryTimeMs!: 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 ) {\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 );\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 openRefreshTokenSubscription(): void {\n this.refreshTokenSubscription = this._refreshToken$.subscribe(refreshToken => {\n const decodedRefreshToken: any = jwt_decode(refreshToken);\n const tokenExp = decodedRefreshToken.exp * 1000;\n const expiryTimeMs = tokenExp - Date.now() - 1000;\n\n this._expiryTimeMs = expiryTimeMs;\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 map(() => {\n this._expiryTimeMs = this._expiryTimeMs - 1000;\n return this._expiryTimeMs;\n }),\n switchMap(expiryTimeMs => {\n if (expiryTimeMs <= this.FIVE_MINUTES_MS) {\n this._counter = new Date(0, 0, 0, 0, 0, 0);\n this._counter.setSeconds(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.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 if (promptVisible && identifier === this.EXPIRE_TOKEN_CONFIRMATION) {\n this.promptService.setBodyText(bodyText);\n }\n });\n\n if (this._expiryTimeMs < 2000) {\n this.logout();\n }\n });\n }\n\n private closeExpiryTimerSubscription(): void {\n this.expiryTimerSubscription?.unsubscribe();\n }\n}\n","/*\n * Copyright 2015-2020 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} from './keycloak-options.service';\nimport {Injector} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakUserService} from './keycloak-user.service';\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 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 = window.location.pathname;\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n logger.debug('Setting redirectTo =', redirectTo);\n window.sessionStorage.setItem('redirectTo', redirectTo);\n window.sessionStorage.setItem('redirectToParams', JSON.stringify(params));\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-2020 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/keycloak-auth-guard.service';\nexport * from './lib/keycloak-user.service';\nexport * from './lib/keycloak.init';\nexport * from './lib/keycloak-options.service';\nexport * from './lib/callback.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i2.KeycloakOptionsService"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;;MCSU,sBAAsB,CAAA;AAGjC,IAAA,WAAA,CAAoB,aAA4B,EAAA;QAA5B,IAAa,CAAA,aAAA,GAAb,aAAa,CAAe;QAC9C,IAAI,CAAC,sBAAsB,GAAG,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC;KAC3E;AAED,IAAA,IAAI,eAAe,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC;KACpD;AAED,IAAA,IAAI,iBAAiB,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC;KACtD;;oHAbU,sBAAsB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,aAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,sBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA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,CAAC;AACb,SAAA;AACH,KAAC,CAAC;AACJ;;ACvDA;;;;;;;;;;;;;;AAcG;;ACdH;;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/keycloak-options.service.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-auth-guard.service.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-user.service.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-2020 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-2020 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-2020 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-2020 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} from './keycloak-options.service';\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 ) {\n logger.debug('callback');\n const savedRedirectTo = window.sessionStorage.getItem('redirectTo');\n const savedRedirectToParams = window.sessionStorage.getItem('redirectToParams');\n const parsedSavedRedirectToParams =\n typeof savedRedirectToParams === 'string' &&\n savedRedirectToParams.length > 2 &&\n JSON.parse(savedRedirectToParams);\n let redirectTo!: string;\n let redirectToParams!: object;\n\n if (savedRedirectTo) {\n redirectTo = savedRedirectTo;\n } else {\n redirectTo = '/';\n }\n\n if (savedRedirectToParams && parsedSavedRedirectToParams) {\n redirectToParams = parsedSavedRedirectToParams;\n }\n\n logger.debug('keycloak callback redirect =', redirectTo);\n logger.debug('keycloak callback redirect params =', savedRedirectToParams);\n\n this.router.navigate([redirectTo], {queryParams: redirectToParams || {}});\n }\n}\n","/*\n * Copyright 2015-2020 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-2020 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-2020 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 if (!requiredRoles || requiredRoles.length === 0) {\n return resolve(true);\n } else {\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","/*\n * Copyright 2015-2020 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 {UserIdentity, UserService, ValtimoUserIdentity} from '@valtimo/config';\nimport {KeycloakOptionsService} from './keycloak-options.service';\nimport jwt_decode from 'jwt-decode';\nimport {PromptService} from '@valtimo/user-interface';\nimport {TranslateService} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\nimport {take} from 'rxjs/operators';\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 _expiryTimeMs!: 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 ) {\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 );\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 openRefreshTokenSubscription(): void {\n this.refreshTokenSubscription = this._refreshToken$.subscribe(refreshToken => {\n const decodedRefreshToken: any = jwt_decode(refreshToken);\n const tokenExp = decodedRefreshToken.exp * 1000;\n const expiryTimeMs = tokenExp - Date.now() - 1000;\n\n this._expiryTimeMs = expiryTimeMs;\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 map(() => {\n this._expiryTimeMs = this._expiryTimeMs - 1000;\n return this._expiryTimeMs;\n }),\n switchMap(expiryTimeMs => {\n if (expiryTimeMs <= this.FIVE_MINUTES_MS) {\n this._counter = new Date(0, 0, 0, 0, 0, 0);\n this._counter.setSeconds(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.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 if (promptVisible && identifier === this.EXPIRE_TOKEN_CONFIRMATION) {\n this.promptService.setBodyText(bodyText);\n }\n });\n\n if (this._expiryTimeMs < 2000) {\n this.logout();\n }\n });\n }\n\n private closeExpiryTimerSubscription(): void {\n this.expiryTimerSubscription?.unsubscribe();\n }\n}\n","/*\n * Copyright 2015-2020 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} from './keycloak-options.service';\nimport {Injector} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakUserService} from './keycloak-user.service';\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 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 = window.location.pathname;\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n logger.debug('Setting redirectTo =', redirectTo);\n window.sessionStorage.setItem('redirectTo', redirectTo);\n window.sessionStorage.setItem('redirectToParams', JSON.stringify(params));\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-2020 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/keycloak-auth-guard.service';\nexport * from './lib/keycloak-user.service';\nexport * from './lib/keycloak.init';\nexport * from './lib/keycloak-options.service';\nexport * from './lib/callback.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i2.KeycloakOptionsService"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;;MCSU,sBAAsB,CAAA;AAGjC,IAAA,WAAA,CAAoB,aAA4B,EAAA;QAA5B,IAAa,CAAA,aAAA,GAAb,aAAa,CAAe;QAC9C,IAAI,CAAC,sBAAsB,GAAG,aAAa,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC;KAC3E;AAED,IAAA,IAAI,eAAe,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,sBAAsB,CAAC,eAAe,CAAC;KACpD;AAED,IAAA,IAAI,iBAAiB,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC;KACtD;;oHAbU,sBAAsB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,aAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,sBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,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or(router: Router, keycloakOptionsService: KeycloakOptionsService, logger: NGXLogger);
|
|
10
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<CallbackComponent, never>;
|
|
11
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CallbackComponent, "valtimo-keycloak-callback", never, {}, {}, never, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CallbackComponent, "valtimo-keycloak-callback", never, {}, {}, never, never, false>;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=callback.component.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valtimo/keycloak",
|
|
3
3
|
"license": "EUPL-1.2",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "10.0.0",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@angular/common": "^
|
|
7
|
-
"@angular/core": "^
|
|
6
|
+
"@angular/common": "^14.2.5",
|
|
7
|
+
"@angular/core": "^14.2.5"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"keycloak-angular": "^
|
|
11
|
-
"keycloak-js": "^
|
|
10
|
+
"keycloak-angular": "^12.1.0",
|
|
11
|
+
"keycloak-js": "^19.0.3",
|
|
12
12
|
"tslib": "^2.0.0"
|
|
13
13
|
},
|
|
14
14
|
"module": "fesm2015/valtimo-keycloak.mjs",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"esm2020": "esm2020/valtimo-keycloak.mjs",
|
|
17
17
|
"fesm2020": "fesm2020/valtimo-keycloak.mjs",
|
|
18
18
|
"fesm2015": "fesm2015/valtimo-keycloak.mjs",
|
|
19
|
-
"typings": "
|
|
19
|
+
"typings": "index.d.ts",
|
|
20
20
|
"exports": {
|
|
21
21
|
"./package.json": {
|
|
22
22
|
"default": "./package.json"
|
|
23
23
|
},
|
|
24
24
|
".": {
|
|
25
|
-
"types": "./
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
26
|
"esm2020": "./esm2020/valtimo-keycloak.mjs",
|
|
27
27
|
"es2020": "./fesm2020/valtimo-keycloak.mjs",
|
|
28
28
|
"es2015": "./fesm2015/valtimo-keycloak.mjs",
|