@valtimo/keycloak 10.4.0 → 10.5.1

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.
Files changed (44) hide show
  1. package/esm2020/lib/callback.component.mjs +22 -16
  2. package/esm2020/lib/constants/index.mjs +17 -0
  3. package/esm2020/lib/constants/storage-keys.mjs +23 -0
  4. package/esm2020/lib/keycloak-routing.module.mjs +2 -2
  5. package/esm2020/lib/keycloak.init.mjs +8 -9
  6. package/esm2020/lib/keycloak.module.mjs +2 -2
  7. package/esm2020/lib/models/index.mjs +2 -2
  8. package/esm2020/lib/models/keycloak.config.mjs +2 -2
  9. package/esm2020/lib/services/index.mjs +20 -0
  10. package/esm2020/lib/services/keycloak-auth-guard.service.mjs +61 -0
  11. package/esm2020/lib/services/keycloak-options.service.mjs +24 -0
  12. package/esm2020/lib/services/keycloak-storage.service.mjs +43 -0
  13. package/esm2020/lib/services/keycloak-user.service.mjs +180 -0
  14. package/esm2020/public_api.mjs +6 -5
  15. package/fesm2015/valtimo-keycloak.mjs +262 -148
  16. package/fesm2015/valtimo-keycloak.mjs.map +1 -1
  17. package/fesm2020/valtimo-keycloak.mjs +264 -151
  18. package/fesm2020/valtimo-keycloak.mjs.map +1 -1
  19. package/lib/callback.component.d.ts +3 -2
  20. package/lib/callback.component.d.ts.map +1 -1
  21. package/lib/constants/index.d.ts +2 -0
  22. package/lib/constants/index.d.ts.map +1 -0
  23. package/lib/constants/storage-keys.d.ts +8 -0
  24. package/lib/constants/storage-keys.d.ts.map +1 -0
  25. package/lib/keycloak.init.d.ts.map +1 -1
  26. package/lib/services/index.d.ts +5 -0
  27. package/lib/services/index.d.ts.map +1 -0
  28. package/lib/services/keycloak-auth-guard.service.d.ts.map +1 -0
  29. package/lib/services/keycloak-options.service.d.ts.map +1 -0
  30. package/lib/services/keycloak-storage.service.d.ts +11 -0
  31. package/lib/services/keycloak-storage.service.d.ts.map +1 -0
  32. package/lib/{keycloak-user.service.d.ts → services/keycloak-user.service.d.ts} +9 -2
  33. package/lib/services/keycloak-user.service.d.ts.map +1 -0
  34. package/package.json +1 -1
  35. package/public_api.d.ts +4 -3
  36. package/public_api.d.ts.map +1 -1
  37. package/esm2020/lib/keycloak-auth-guard.service.mjs +0 -61
  38. package/esm2020/lib/keycloak-options.service.mjs +0 -24
  39. package/esm2020/lib/keycloak-user.service.mjs +0 -162
  40. package/lib/keycloak-auth-guard.service.d.ts.map +0 -1
  41. package/lib/keycloak-options.service.d.ts.map +0 -1
  42. package/lib/keycloak-user.service.d.ts.map +0 -1
  43. /package/lib/{keycloak-auth-guard.service.d.ts → services/keycloak-auth-guard.service.d.ts} +0 -0
  44. /package/lib/{keycloak-options.service.d.ts → services/keycloak-options.service.d.ts} +0 -0
@@ -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,eA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CAAC;YAEhD,mBAAmB,CAAC,IAAI,EAAE,CAAC;AAE3B,YAAA,OAAO,UAAU,CAAC;AACnB,SAAA;AAAC,QAAA,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;AAClD,YAAA,MAAM,KAAK,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/constants/storage-keys.ts","../../../../projects/valtimo/keycloak/src/lib/constants/index.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-auth-guard.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-options.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-storage.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-user.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/index.ts","../../../../projects/valtimo/keycloak/src/lib/callback.component.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-routing.module.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak.module.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak.init.ts","../../../../projects/valtimo/keycloak/src/public_api.ts","../../../../projects/valtimo/keycloak/src/valtimo-keycloak.ts"],"sourcesContent":["/*\n * Copyright 2015-2023 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-2023 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-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst STORAGE_KEYS = {\n urlBeforeExpiration: 'urlBeforeExpiration',\n urlBeforeExpirationParams: 'urlBeforeExpirationParams',\n redirectTo: 'redirectTo',\n redirectToParams: 'redirectToParams',\n};\n\nexport {STORAGE_KEYS};\n","/*\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './storage-keys';\n","/*\n * Copyright 2015-2023 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-2023 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-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakStorageService {\n getCurrentUrlParams(): string {\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n return JSON.stringify(params);\n }\n\n getCurrentUrl(): string {\n return window.location.pathname;\n }\n\n parseSavedParams(savedParams: any): {[key: string]: string} {\n return (\n (savedParams &&\n typeof savedParams === 'string' &&\n savedParams.length > 2 &&\n JSON.parse(savedParams)) ||\n {}\n );\n }\n}\n","/*\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable, OnDestroy} from '@angular/core';\nimport {combineLatest, map, ReplaySubject, Subject, Subscription, switchMap, timer} from 'rxjs';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakEventType, KeycloakService} from 'keycloak-angular';\nimport {ConfigService, UserIdentity, UserService, ValtimoUserIdentity} from '@valtimo/config';\nimport {KeycloakOptionsService} from './keycloak-options.service';\nimport 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';\nimport {Router} from '@angular/router';\nimport {STORAGE_KEYS} from '../constants';\nimport {KeycloakStorageService} from './keycloak-storage.service';\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 private readonly configService: ConfigService,\n private readonly router: Router,\n private readonly keycloakStorageService: KeycloakStorageService\n ) {\n this.openTokenRefreshSubscription();\n this.openRefreshTokenSubscription();\n }\n\n ngOnDestroy(): void {\n this.tokenRefreshSubscription?.unsubscribe();\n this.refreshTokenSubscription?.unsubscribe();\n this.closeExpiryTimerSubscription();\n }\n\n init(): void {\n this.userIdentity = new ReplaySubject();\n this.keycloakService.loadUserProfile().then(user => {\n this.logger.debug('KeycloakUserService: loadUserProfile = ', user);\n const roles: Array<string> = [];\n this.keycloakService.getUserRoles(true).forEach(role => roles.push(role));\n const valtimoUserIdentity = new ValtimoUserIdentity(\n user.email,\n user.firstName,\n user.lastName,\n roles,\n user.username\n );\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.openConfirmationPrompt(headerText, bodyText, cancelButtonText, confirmButtonText);\n }\n\n if (promptVisible && identifier === this.EXPIRE_TOKEN_CONFIRMATION) {\n this.promptService.setBodyText(bodyText);\n }\n });\n\n if (this._expiryTimeMs < 2000) {\n this.saveUrl();\n this.logout();\n }\n });\n }\n\n private closeExpiryTimerSubscription(): void {\n this.expiryTimerSubscription?.unsubscribe();\n }\n\n private openConfirmationPrompt(\n headerText: string,\n bodyText: string,\n cancelButtonText: string,\n confirmButtonText: string\n ): void {\n this.promptService.openPrompt({\n identifier: this.EXPIRE_TOKEN_CONFIRMATION,\n headerText,\n bodyText,\n cancelButtonText,\n confirmButtonText,\n cancelMdiIcon: 'logout',\n confirmMdiIcon: 'check',\n closeOnConfirm: true,\n closeOnCancel: false,\n cancelCallbackFunction: () => {\n this.keycloakService.logout();\n },\n confirmCallBackFunction: () => {\n this.closeExpiryTimerSubscription();\n this.updateToken(20);\n },\n });\n }\n\n private saveUrl(): void {\n const returnToLastUrlAfterTokenExpiration =\n this.configService?.config?.featureToggles?.returnToLastUrlAfterTokenExpiration;\n\n if (returnToLastUrlAfterTokenExpiration) {\n sessionStorage.setItem(\n STORAGE_KEYS.urlBeforeExpiration,\n this.keycloakStorageService.getCurrentUrl()\n );\n sessionStorage.setItem(\n STORAGE_KEYS.urlBeforeExpirationParams,\n this.keycloakStorageService.getCurrentUrlParams()\n );\n }\n }\n}\n","/*\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './keycloak-auth-guard.service';\nexport * from './keycloak-options.service';\nexport * from './keycloak-user.service';\nexport * from './keycloak-storage.service';\n","/*\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakOptionsService, KeycloakStorageService} from './services';\nimport {STORAGE_KEYS} from './constants';\n\n@Component({\n selector: 'valtimo-keycloak-callback',\n template: '',\n})\nexport class CallbackComponent {\n constructor(\n private router: Router,\n private keycloakOptionsService: KeycloakOptionsService,\n private logger: NGXLogger,\n private readonly keycloakStorageService: KeycloakStorageService\n ) {\n logger.debug('callback');\n const savedRedirectTo = window.sessionStorage.getItem(STORAGE_KEYS.redirectTo);\n const savedRedirectToParams = window.sessionStorage.getItem(STORAGE_KEYS.redirectToParams);\n const parsedSavedRedirectToParams =\n this.keycloakStorageService.parseSavedParams(savedRedirectToParams);\n\n const urlBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpiration);\n const paramsBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpirationParams);\n const parsedParamsBeforeExpiration =\n this.keycloakStorageService.parseSavedParams(paramsBeforeExpiration);\n\n let redirectTo!: string;\n\n if (savedRedirectTo) {\n redirectTo = savedRedirectTo;\n } else {\n redirectTo = '/';\n }\n\n logger.debug('keycloak callback redirect =', redirectTo);\n logger.debug('keycloak callback redirect params =', savedRedirectToParams);\n\n if (STORAGE_KEYS.urlBeforeExpiration in sessionStorage) {\n this.router.navigate([urlBeforeExpiration], {queryParams: parsedParamsBeforeExpiration});\n sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpiration);\n sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpirationParams);\n } else {\n this.router.navigate([redirectTo], {queryParams: parsedSavedRedirectToParams});\n }\n }\n}\n","/*\n * Copyright 2015-2023 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-2023 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-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {KeycloakService} from 'keycloak-angular';\nimport {KeycloakOptionsService, KeycloakStorageService, KeycloakUserService} from './services';\nimport {Injector} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {STORAGE_KEYS} from './constants';\n\nexport function keycloakInitializer(injector: Injector): () => Promise<any> {\n const keycloakService = injector.get<KeycloakService>(KeycloakService);\n const keycloakUserService = injector.get<KeycloakUserService>(KeycloakUserService);\n const optionsService = injector.get<KeycloakOptionsService>(KeycloakOptionsService); // TODO possible removal of abstraction\n const storageService = injector.get<KeycloakStorageService>(KeycloakStorageService);\n const logger = injector.get<NGXLogger>(NGXLogger);\n\n return async (): Promise<any> => {\n try {\n logger.debug('Keycloak initializer before init');\n\n const keycloakOptions = optionsService.keycloakOptions;\n const currentUrl = window.location.href.split('#')[0];\n\n if (keycloakOptions.initOptions.redirectUri !== currentUrl) {\n const redirectTo = storageService.getCurrentUrl();\n logger.debug('Setting redirectTo =', redirectTo);\n window.sessionStorage.setItem(STORAGE_KEYS.redirectTo, redirectTo);\n window.sessionStorage.setItem(\n STORAGE_KEYS.redirectToParams,\n storageService.getCurrentUrlParams()\n );\n }\n\n const initResult = await keycloakService.init(keycloakOptions);\n logger.debug('Keycloak initializer after init');\n\n keycloakUserService.init();\n\n return initResult;\n } catch (error) {\n logger.debug('Keycloak initializer error', error);\n throw error;\n }\n };\n}\n","/*\n * Copyright 2015-2023 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of keycloak\n */\n\nexport * from './lib/models';\nexport * from './lib/keycloak.module';\nexport * from './lib/services/keycloak-auth-guard.service';\nexport * from './lib/services/keycloak-user.service';\nexport * from './lib/keycloak.init';\nexport * from './lib/services/keycloak-options.service';\nexport * from './lib/callback.component';\nexport * from './lib/constants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i2.KeycloakOpt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CAAC,WAAW,KAAK,UAAU,EAAE;AAC1D,gBAAA,MAAM,UAAU,GAAG,cAAc,CAAC,aAAa,EAAE,CAAC;AAClD,gBAAA,MAAM,CAAC,KAAK,CAAC,sBAAsB,EAAE,UAAU,CAAC,CAAC;gBACjD,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACnE,gBAAA,MAAM,CAAC,cAAc,CAAC,OAAO,CAC3B,YAAY,CAAC,gBAAgB,EAC7B,cAAc,CAAC,mBAAmB,EAAE,CACrC,CAAC;AACH,aAAA;YAED,MAAM,UAAU,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAC/D,YAAA,MAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;YAEhD,mBAAmB,CAAC,IAAI,EAAE,CAAC;AAE3B,YAAA,OAAO,UAAU,CAAC;AACnB,SAAA;AAAC,QAAA,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;AAClD,YAAA,MAAM,KAAK,CAAC;AACb,SAAA;AACH,KAAC,CAAC;AACJ;;ACzDA;;;;;;;;;;;;;;AAcG;;ACdH;;AAEG;;;;"}
@@ -1,12 +1,13 @@
1
1
  import { Router } from '@angular/router';
2
2
  import { NGXLogger } from 'ngx-logger';
3
- import { KeycloakOptionsService } from './keycloak-options.service';
3
+ import { KeycloakOptionsService, KeycloakStorageService } from './services';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class CallbackComponent {
6
6
  private router;
7
7
  private keycloakOptionsService;
8
8
  private logger;
9
- constructor(router: Router, keycloakOptionsService: KeycloakOptionsService, logger: NGXLogger);
9
+ private readonly keycloakStorageService;
10
+ constructor(router: Router, keycloakOptionsService: KeycloakOptionsService, logger: NGXLogger, keycloakStorageService: KeycloakStorageService);
10
11
  static ɵfac: i0.ɵɵFactoryDeclaration<CallbackComponent, never>;
11
12
  static ɵcmp: i0.ɵɵComponentDeclaration<CallbackComponent, "valtimo-keycloak-callback", never, {}, {}, never, never, false>;
12
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"callback.component.d.ts","sourceRoot":"","sources":["../../../../projects/valtimo/keycloak/src/lib/callback.component.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4B,CAAC;;AAElE,qBAIa,iBAAiB;IAE1B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,sBAAsB;IAC9B,OAAO,CAAC,MAAM;gBAFN,MAAM,EAAE,MAAM,EACd,sBAAsB,EAAE,sBAAsB,EAC9C,MAAM,EAAE,SAAS;yCAJhB,iBAAiB;2CAAjB,iBAAiB;CA+B7B"}
1
+ {"version":3,"file":"callback.component.d.ts","sourceRoot":"","sources":["../../../../projects/valtimo/keycloak/src/lib/callback.component.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,sBAAsB,EAAE,sBAAsB,EAAC,MAAM,YAAY,CAAC;;AAG1E,qBAIa,iBAAiB;IAE1B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,sBAAsB;IAC9B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,QAAQ,CAAC,sBAAsB;gBAH/B,MAAM,EAAE,MAAM,EACd,sBAAsB,EAAE,sBAAsB,EAC9C,MAAM,EAAE,SAAS,EACR,sBAAsB,EAAE,sBAAsB;yCALtD,iBAAiB;2CAAjB,iBAAiB;CAqC7B"}
@@ -0,0 +1,2 @@
1
+ export * from './storage-keys';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/keycloak/src/lib/constants/index.ts"],"names":[],"mappings":"AAgBA,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ declare const STORAGE_KEYS: {
2
+ urlBeforeExpiration: string;
3
+ urlBeforeExpirationParams: string;
4
+ redirectTo: string;
5
+ redirectToParams: string;
6
+ };
7
+ export { STORAGE_KEYS };
8
+ //# sourceMappingURL=storage-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-keys.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/keycloak/src/lib/constants/storage-keys.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAM,YAAY;;;;;CAKjB,CAAC;AAEF,OAAO,EAAC,YAAY,EAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"keycloak.init.d.ts","sourceRoot":"","sources":["../../../../projects/valtimo/keycloak/src/lib/keycloak.init.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAIvC,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAiC1E"}
1
+ {"version":3,"file":"keycloak.init.d.ts","sourceRoot":"","sources":["../../../../projects/valtimo/keycloak/src/lib/keycloak.init.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAIvC,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAmC1E"}
@@ -0,0 +1,5 @@
1
+ export * from './keycloak-auth-guard.service';
2
+ export * from './keycloak-options.service';
3
+ export * from './keycloak-user.service';
4
+ export * from './keycloak-storage.service';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/keycloak/src/lib/services/index.ts"],"names":[],"mappings":"AAgBA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keycloak-auth-guard.service.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/keycloak/src/lib/services/keycloak-auth-guard.service.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAC,iBAAiB,EAAE,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAC,sBAAsB,EAAE,WAAW,EAAE,MAAM,EAAE,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AACjG,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;;AAErC,qBAGa,wBAAyB,SAAQ,iBAAkB,YAAW,WAAW;IAElF,SAAS,CAAC,MAAM,EAAE,MAAM;IACxB,SAAS,CAAC,eAAe,EAAE,eAAe;IAC1C,OAAO,CAAC,MAAM;gBAFJ,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe,EAClC,MAAM,EAAE,SAAS;IAM3B,eAAe,CAAC,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;yCAVjF,wBAAwB;6CAAxB,wBAAwB;CAgCpC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keycloak-options.service.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/keycloak/src/lib/services/keycloak-options.service.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;;AAE9C,qBAGa,sBAAsB;IAGrB,OAAO,CAAC,aAAa;IAFjC,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAyB;gBAE5C,aAAa,EAAE,aAAa;IAIhD,IAAI,eAAe,+CAElB;IAED,IAAI,iBAAiB,WAEpB;yCAbU,sBAAsB;6CAAtB,sBAAsB;CAclC"}
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class KeycloakStorageService {
3
+ getCurrentUrlParams(): string;
4
+ getCurrentUrl(): string;
5
+ parseSavedParams(savedParams: any): {
6
+ [key: string]: string;
7
+ };
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<KeycloakStorageService, never>;
9
+ static ɵprov: i0.ɵɵInjectableDeclaration<KeycloakStorageService>;
10
+ }
11
+ //# sourceMappingURL=keycloak-storage.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keycloak-storage.service.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/keycloak/src/lib/services/keycloak-storage.service.ts"],"names":[],"mappings":";AAkBA,qBAGa,sBAAsB;IACjC,mBAAmB,IAAI,MAAM;IAM7B,aAAa,IAAI,MAAM;IAIvB,gBAAgB,CAAC,WAAW,EAAE,GAAG,GAAG;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC;yCAXhD,sBAAsB;6CAAtB,sBAAsB;CAoBlC"}
@@ -2,11 +2,13 @@ import { OnDestroy } from '@angular/core';
2
2
  import { ReplaySubject } from 'rxjs';
3
3
  import { NGXLogger } from 'ngx-logger';
4
4
  import { KeycloakService } from 'keycloak-angular';
5
- import { UserIdentity, UserService } from '@valtimo/config';
5
+ import { ConfigService, UserIdentity, UserService } from '@valtimo/config';
6
6
  import { KeycloakOptionsService } from './keycloak-options.service';
7
7
  import { PromptService } from '@valtimo/user-interface';
8
8
  import { TranslateService } from '@ngx-translate/core';
9
9
  import { DatePipe } from '@angular/common';
10
+ import { Router } from '@angular/router';
11
+ import { KeycloakStorageService } from './keycloak-storage.service';
10
12
  import * as i0 from "@angular/core";
11
13
  export declare class KeycloakUserService implements UserService, OnDestroy {
12
14
  private readonly keycloakService;
@@ -15,6 +17,9 @@ export declare class KeycloakUserService implements UserService, OnDestroy {
15
17
  private readonly promptService;
16
18
  private readonly translateService;
17
19
  private readonly datePipe;
20
+ private readonly configService;
21
+ private readonly router;
22
+ private readonly keycloakStorageService;
18
23
  private userIdentity;
19
24
  private tokenRefreshSubscription;
20
25
  private refreshTokenSubscription;
@@ -24,7 +29,7 @@ export declare class KeycloakUserService implements UserService, OnDestroy {
24
29
  private readonly FIVE_MINUTES_MS;
25
30
  private readonly EXPIRE_TOKEN_CONFIRMATION;
26
31
  private _counter;
27
- constructor(keycloakService: KeycloakService, keycloakOptionsService: KeycloakOptionsService, logger: NGXLogger, promptService: PromptService, translateService: TranslateService, datePipe: DatePipe);
32
+ constructor(keycloakService: KeycloakService, keycloakOptionsService: KeycloakOptionsService, logger: NGXLogger, promptService: PromptService, translateService: TranslateService, datePipe: DatePipe, configService: ConfigService, router: Router, keycloakStorageService: KeycloakStorageService);
28
33
  ngOnDestroy(): void;
29
34
  init(): void;
30
35
  getUserSubject(): ReplaySubject<UserIdentity>;
@@ -36,6 +41,8 @@ export declare class KeycloakUserService implements UserService, OnDestroy {
36
41
  private setRefreshToken;
37
42
  private openExpiryTimerSubscription;
38
43
  private closeExpiryTimerSubscription;
44
+ private openConfirmationPrompt;
45
+ private saveUrl;
39
46
  static ɵfac: i0.ɵɵFactoryDeclaration<KeycloakUserService, never>;
40
47
  static ɵprov: i0.ɵɵInjectableDeclaration<KeycloakUserService>;
41
48
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keycloak-user.service.d.ts","sourceRoot":"","sources":["../../../../../projects/valtimo/keycloak/src/lib/services/keycloak-user.service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAa,SAAS,EAAC,MAAM,eAAe,CAAC;AACpD,OAAO,EAAqB,aAAa,EAA0C,MAAM,MAAM,CAAC;AAChG,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AACrC,OAAO,EAAoB,eAAe,EAAC,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,WAAW,EAAsB,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAC,sBAAsB,EAAC,MAAM,4BAA4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BAAsB;IAMjE,WAAW,IAAI,IAAI;IAMnB,IAAI,IAAI,IAAI;IAmBZ,cAAc,IAAI,aAAa,CAAC,YAAY,CAAC;IAK7C,MAAM,IAAI,IAAI;IAKR,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAK3B,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxD,OAAO,CAAC,4BAA4B;IAUpC,OAAO,CAAC,4BAA4B;IAYpC,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,2BAA2B;IA6CnC,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,sBAAsB;IA0B9B,OAAO,CAAC,OAAO;yCAlLJ,mBAAmB;6CAAnB,mBAAmB;CAiM/B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valtimo/keycloak",
3
3
  "license": "EUPL-1.2",
4
- "version": "10.4.0",
4
+ "version": "10.5.1",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^14.2.5",
7
7
  "@angular/core": "^14.2.5"
package/public_api.d.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  export * from './lib/models';
2
2
  export * from './lib/keycloak.module';
3
- export * from './lib/keycloak-auth-guard.service';
4
- export * from './lib/keycloak-user.service';
3
+ export * from './lib/services/keycloak-auth-guard.service';
4
+ export * from './lib/services/keycloak-user.service';
5
5
  export * from './lib/keycloak.init';
6
- export * from './lib/keycloak-options.service';
6
+ export * from './lib/services/keycloak-options.service';
7
7
  export * from './lib/callback.component';
8
+ export * from './lib/constants';
8
9
  //# sourceMappingURL=public_api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../../projects/valtimo/keycloak/src/public_api.ts"],"names":[],"mappings":"AAoBA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../../projects/valtimo/keycloak/src/public_api.ts"],"names":[],"mappings":"AAoBA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,qBAAqB,CAAC;AACpC,cAAc,yCAAyC,CAAC;AACxD,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC"}
@@ -1,61 +0,0 @@
1
- /*
2
- * Copyright 2015-2020 Ritense BV, the Netherlands.
3
- *
4
- * Licensed under EUPL, Version 1.2 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" basis,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { Injectable } from '@angular/core';
17
- import { KeycloakAuthGuard } from 'keycloak-angular';
18
- import * as i0 from "@angular/core";
19
- import * as i1 from "@angular/router";
20
- import * as i2 from "keycloak-angular";
21
- import * as i3 from "ngx-logger";
22
- export class KeycloakAuthGuardService extends KeycloakAuthGuard {
23
- constructor(router, keycloakAngular, logger) {
24
- super(router, keycloakAngular);
25
- this.router = router;
26
- this.keycloakAngular = keycloakAngular;
27
- this.logger = logger;
28
- this.logger.debug('KeycloakAuthGuardService: ctor');
29
- }
30
- isAccessAllowed(route, state) {
31
- this.logger.debug('KeycloakAuthGuardService: isAccessAllowed');
32
- return new Promise((resolve, reject) => {
33
- this.logger.debug('KeycloakAuthGuardService: isAccessAllowed checking access');
34
- if (!this.authenticated) {
35
- this.keycloakAngular
36
- .login()
37
- .catch(e => `KeycloakAuthGuardService error: ${this.logger.error(e)}`);
38
- return reject(false);
39
- }
40
- const requiredRoles = route.data.roles;
41
- if (!requiredRoles || requiredRoles.length === 0) {
42
- return resolve(true);
43
- }
44
- else {
45
- if (!this.roles || this.roles.length === 0) {
46
- resolve(false);
47
- }
48
- resolve(requiredRoles.some(role => this.roles.includes(role)));
49
- }
50
- });
51
- }
52
- }
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
- type: Injectable,
57
- args: [{
58
- providedIn: 'root',
59
- }]
60
- }], ctorParameters: function () { return [{ type: i1.Router }, { type: i2.KeycloakService }, { type: i3.NGXLogger }]; } });
61
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5Y2xvYWstYXV0aC1ndWFyZC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdmFsdGltby9rZXljbG9hay9zcmMvbGliL2tleWNsb2FrLWF1dGgtZ3VhcmQuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7R0FjRztBQUVILE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFDLGlCQUFpQixFQUFrQixNQUFNLGtCQUFrQixDQUF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B7XG4gICAgICAgICAgcmVzb2x2ZShmYWxzZSk7XG4gICAgICAgIH1cbiAgICAgICAgcmVzb2x2ZShyZXF1aXJlZFJvbGVzLnNvbWUocm9sZSA9PiB0aGlzLnJvbGVzLmluY2x1ZGVzKHJvbGUpKSk7XG4gICAgICB9XG4gICAgfSk7XG4gIH1cbn1cbiJdfQ==
@@ -1,24 +0,0 @@
1
- import { Injectable } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@valtimo/config";
4
- export class KeycloakOptionsService {
5
- constructor(configService) {
6
- this.configService = configService;
7
- this.valtimoKeycloakOptions = configService.config.authentication.options;
8
- }
9
- get keycloakOptions() {
10
- return this.valtimoKeycloakOptions.keycloakOptions;
11
- }
12
- get logoutRedirectUri() {
13
- return this.valtimoKeycloakOptions.logoutRedirectUri;
14
- }
15
- }
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
- type: Injectable,
20
- args: [{
21
- providedIn: 'root',
22
- }]
23
- }], ctorParameters: function () { return [{ type: i1.ConfigService }]; } });
24
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5Y2xvYWstb3B0aW9ucy5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdmFsdGltby9rZXljbG9hay9zcmMvbGliL2tleWNsb2FrLW9wdGlvbnMuc2VydmljZS50cyJdLCJuYW1lcy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