@valtimo/keycloak 12.4.0 → 12.4.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"valtimo-keycloak.mjs","sources":["../../../../projects/valtimo/keycloak/src/lib/models/keycloak.config.ts","../../../../projects/valtimo/keycloak/src/lib/models/index.ts","../../../../projects/valtimo/keycloak/src/lib/constants/storage-keys.ts","../../../../projects/valtimo/keycloak/src/lib/constants/index.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-auth-guard.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-options.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-storage.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-user.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/index.ts","../../../../projects/valtimo/keycloak/src/lib/callback.component.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-routing.module.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak.module.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak.init.ts","../../../../projects/valtimo/keycloak/src/public_api.ts","../../../../projects/valtimo/keycloak/src/valtimo-keycloak.ts"],"sourcesContent":["/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {KeycloakOptions} from 'keycloak-angular';\n\nexport interface ValtimoKeycloakOptions {\n keycloakOptions: KeycloakOptions;\n logoutRedirectUri: string;\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './keycloak.config';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst STORAGE_KEYS = {\n urlBeforeExpiration: 'urlBeforeExpiration',\n urlBeforeExpirationParams: 'urlBeforeExpirationParams',\n redirectTo: 'redirectTo',\n redirectToParams: 'redirectToParams',\n};\n\nexport {STORAGE_KEYS};\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './storage-keys';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {KeycloakAuthGuard, KeycloakService} from 'keycloak-angular';\nimport {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakAuthGuardService extends KeycloakAuthGuard implements CanActivate {\n constructor(\n protected router: Router,\n protected keycloakAngular: KeycloakService,\n private logger: NGXLogger\n ) {\n super(router, keycloakAngular);\n this.logger.debug('KeycloakAuthGuardService: ctor');\n }\n\n isAccessAllowed(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> {\n this.logger.debug('KeycloakAuthGuardService: isAccessAllowed');\n return new Promise((resolve, reject) => {\n this.logger.debug('KeycloakAuthGuardService: isAccessAllowed checking access');\n if (!this.authenticated) {\n this.keycloakAngular\n .login()\n .catch(e => `KeycloakAuthGuardService error: ${this.logger.error(e)}`);\n return reject(false);\n }\n\n const requiredRoles: string[] = route.data.roles;\n\n if (!requiredRoles || requiredRoles.length === 0) {\n return resolve(true);\n }\n\n if (!this.roles || this.roles.length === 0) {\n resolve(false);\n }\n resolve(requiredRoles.some(role => this.roles.includes(role)));\n });\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {ValtimoKeycloakOptions} from '../models';\nimport {Injectable} from '@angular/core';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakOptionsService {\n private readonly valtimoKeycloakOptions: ValtimoKeycloakOptions;\n\n constructor(private configService: ConfigService) {\n this.valtimoKeycloakOptions = configService.config.authentication.options;\n }\n\n get keycloakOptions() {\n return this.valtimoKeycloakOptions.keycloakOptions;\n }\n\n get logoutRedirectUri() {\n return this.valtimoKeycloakOptions.logoutRedirectUri;\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakStorageService {\n getCurrentUrlParams(): string {\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n return JSON.stringify(params);\n }\n\n getCurrentUrl(): string {\n return window.location.pathname;\n }\n\n parseSavedParams(savedParams: any): {[key: string]: string} {\n return (\n (savedParams &&\n typeof savedParams === 'string' &&\n savedParams.length > 2 &&\n JSON.parse(savedParams)) ||\n {}\n );\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable, OnDestroy} from '@angular/core';\nimport {combineLatest, map, ReplaySubject, Subject, Subscription, switchMap, timer} from 'rxjs';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakEventType, KeycloakService} from 'keycloak-angular';\nimport {ConfigService, UserIdentity, UserService, ValtimoUserIdentity} from '@valtimo/config';\nimport {KeycloakOptionsService} from './keycloak-options.service';\nimport {jwtDecode} from 'jwt-decode';\nimport {TranslateService} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\nimport {take} from 'rxjs/operators';\nimport {Router} from '@angular/router';\nimport {STORAGE_KEYS} from '../constants';\nimport {KeycloakStorageService} from './keycloak-storage.service';\nimport {PromptService} from '@valtimo/components';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakUserService implements UserService, OnDestroy {\n private userIdentity: ReplaySubject<UserIdentity>;\n\n private tokenRefreshSubscription!: Subscription;\n private refreshTokenSubscription!: Subscription;\n private expiryTimerSubscription!: Subscription;\n\n private readonly _refreshToken$ = new Subject<string>();\n\n private _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 user.id\n );\n this.logger.debug('KeycloakUserService: loaded user identity', valtimoUserIdentity);\n this.userIdentity.next(valtimoUserIdentity);\n });\n this.setRefreshToken();\n }\n\n getUserSubject(): ReplaySubject<UserIdentity> {\n this.logger.debug('KeycloakUserService: getUserIdentity');\n return this.userIdentity;\n }\n\n logout(): void {\n this.logger.debug('KeycloakUserService: logout');\n this.keycloakService.logout(this.keycloakOptionsService.logoutRedirectUri);\n }\n\n async getToken(): Promise<string> {\n this.logger.debug('KeycloakUserService: getToken');\n return this.keycloakService.getToken();\n }\n\n async updateToken(minValidity: number): Promise<boolean> {\n this.logger.debug('KeycloakUserService: updateToken');\n return this.keycloakService.updateToken(minValidity);\n }\n\n private openTokenRefreshSubscription(): void {\n this.tokenRefreshSubscription = this.keycloakService.keycloakEvents$.subscribe(\n keycloakEvent => {\n if (keycloakEvent.type === KeycloakEventType.OnAuthRefreshSuccess) {\n this.setRefreshToken();\n }\n }\n );\n }\n\n private openRefreshTokenSubscription(): void {\n this.refreshTokenSubscription = this._refreshToken$.subscribe(refreshToken => {\n const decodedRefreshToken = jwtDecode(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-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './keycloak-auth-guard.service';\nexport * from './keycloak-options.service';\nexport * from './keycloak-user.service';\nexport * from './keycloak-storage.service';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakOptionsService, KeycloakStorageService} from './services';\nimport {STORAGE_KEYS} from './constants';\n\n@Component({\n selector: 'valtimo-keycloak-callback',\n template: '',\n})\nexport class CallbackComponent {\n constructor(\n private router: Router,\n private keycloakOptionsService: KeycloakOptionsService,\n private logger: NGXLogger,\n private readonly keycloakStorageService: KeycloakStorageService\n ) {\n logger.debug('callback');\n const savedRedirectTo = window.sessionStorage.getItem(STORAGE_KEYS.redirectTo);\n const savedRedirectToParams = window.sessionStorage.getItem(STORAGE_KEYS.redirectToParams);\n const parsedSavedRedirectToParams =\n this.keycloakStorageService.parseSavedParams(savedRedirectToParams);\n\n const urlBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpiration);\n const paramsBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpirationParams);\n const parsedParamsBeforeExpiration =\n this.keycloakStorageService.parseSavedParams(paramsBeforeExpiration);\n\n let redirectTo!: string;\n\n if (savedRedirectTo) {\n redirectTo = savedRedirectTo;\n } else {\n redirectTo = '/';\n }\n\n logger.debug('keycloak callback redirect =', redirectTo);\n logger.debug('keycloak callback redirect params =', savedRedirectToParams);\n\n if (STORAGE_KEYS.urlBeforeExpiration in sessionStorage) {\n this.router.navigate([urlBeforeExpiration], {queryParams: parsedParamsBeforeExpiration});\n sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpiration);\n sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpirationParams);\n } else {\n this.router.navigate([redirectTo], {queryParams: parsedSavedRedirectToParams});\n }\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CallbackComponent} from './callback.component';\nimport {CommonModule} from '@angular/common';\n\nconst routes: Routes = [\n {\n path: 'keycloak/callback',\n component: CallbackComponent,\n data: {title: 'Loading...'},\n },\n];\n\n@NgModule({\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class KeycloakRoutingModule {}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {KeycloakAngularModule} from 'keycloak-angular';\nimport {CallbackComponent} from './callback.component';\nimport {KeycloakRoutingModule} from './keycloak-routing.module';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\n\n@NgModule({\n declarations: [CallbackComponent],\n imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule],\n exports: [CallbackComponent],\n providers: [DatePipe],\n})\nexport class KeycloakModule {}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {KeycloakService} from 'keycloak-angular';\nimport {KeycloakOptionsService, KeycloakStorageService, KeycloakUserService} from './services';\nimport {Injector} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {STORAGE_KEYS} from './constants';\n\nexport function keycloakInitializer(injector: Injector): () => Promise<any> {\n const keycloakService = injector.get<KeycloakService>(KeycloakService);\n const keycloakUserService = injector.get<KeycloakUserService>(KeycloakUserService);\n const optionsService = injector.get<KeycloakOptionsService>(KeycloakOptionsService); // TODO possible removal of abstraction\n const storageService = injector.get<KeycloakStorageService>(KeycloakStorageService);\n const logger = injector.get<NGXLogger>(NGXLogger);\n\n return async (): Promise<any> => {\n try {\n logger.debug('Keycloak initializer before init');\n\n const keycloakOptions = optionsService.keycloakOptions;\n const currentUrl = window.location.href.split('#')[0];\n\n if (keycloakOptions.initOptions.redirectUri !== currentUrl) {\n const redirectTo = storageService.getCurrentUrl();\n logger.debug('Setting redirectTo =', redirectTo);\n window.sessionStorage.setItem(STORAGE_KEYS.redirectTo, redirectTo);\n window.sessionStorage.setItem(\n STORAGE_KEYS.redirectToParams,\n storageService.getCurrentUrlParams()\n );\n }\n\n const initResult = await keycloakService.init(keycloakOptions);\n logger.debug('Keycloak initializer after init');\n\n keycloakUserService.init();\n\n return initResult;\n } catch (error) {\n logger.debug('Keycloak initializer error', error);\n throw error;\n }\n };\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of keycloak\n */\n\nexport * from './lib/models';\nexport * from './lib/keycloak.module';\nexport * from './lib/services/keycloak-auth-guard.service';\nexport * from './lib/services/keycloak-user.service';\nexport * from './lib/keycloak.init';\nexport * from './lib/services/keycloak-options.service';\nexport * from './lib/callback.component';\nexport * from './lib/constants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i2.KeycloakOptionsService","i7","i8","i9.KeycloakStorageService","i2.KeycloakStorageService"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;AAEH,MAAM,YA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,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;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;SACnB;QAAC,OAAO,KAAK,EAAE;AACd,YAAA,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;AAClD,YAAA,MAAM,KAAK,CAAC;SACb;AACH,KAAC,CAAC;AACJ;;ACzDA;;;;;;;;;;;;;;AAcG;AAEH;;AAEG;;AClBH;;AAEG;;;;"}
1
+ {"version":3,"file":"valtimo-keycloak.mjs","sources":["../../../../projects/valtimo/keycloak/src/lib/models/keycloak.config.ts","../../../../projects/valtimo/keycloak/src/lib/models/index.ts","../../../../projects/valtimo/keycloak/src/lib/constants/storage-keys.ts","../../../../projects/valtimo/keycloak/src/lib/constants/index.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-auth-guard.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-options.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-storage.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/keycloak-user.service.ts","../../../../projects/valtimo/keycloak/src/lib/services/index.ts","../../../../projects/valtimo/keycloak/src/lib/callback.component.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak-routing.module.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak.module.ts","../../../../projects/valtimo/keycloak/src/lib/keycloak.init.ts","../../../../projects/valtimo/keycloak/src/public_api.ts","../../../../projects/valtimo/keycloak/src/valtimo-keycloak.ts"],"sourcesContent":["/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {KeycloakOptions} from 'keycloak-angular';\n\nexport interface ValtimoKeycloakOptions {\n keycloakOptions: KeycloakOptions;\n logoutRedirectUri: string;\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './keycloak.config';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst STORAGE_KEYS = {\n urlBeforeExpiration: 'urlBeforeExpiration',\n urlBeforeExpirationParams: 'urlBeforeExpirationParams',\n redirectTo: 'redirectTo',\n redirectToParams: 'redirectToParams',\n};\n\nexport {STORAGE_KEYS};\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './storage-keys';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {KeycloakAuthGuard, KeycloakService} from 'keycloak-angular';\nimport {ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakAuthGuardService extends KeycloakAuthGuard implements CanActivate {\n constructor(\n protected router: Router,\n protected keycloakAngular: KeycloakService,\n private logger: NGXLogger\n ) {\n super(router, keycloakAngular);\n this.logger.debug('KeycloakAuthGuardService: ctor');\n }\n\n isAccessAllowed(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> {\n this.logger.debug('KeycloakAuthGuardService: isAccessAllowed');\n return new Promise((resolve, reject) => {\n this.logger.debug('KeycloakAuthGuardService: isAccessAllowed checking access');\n if (!this.authenticated) {\n this.keycloakAngular\n .login()\n .catch(e => `KeycloakAuthGuardService error: ${this.logger.error(e)}`);\n return reject(false);\n }\n\n const requiredRoles: string[] = route.data.roles;\n\n if (!requiredRoles || requiredRoles.length === 0) {\n return resolve(true);\n }\n\n if (!this.roles || this.roles.length === 0) {\n resolve(false);\n }\n resolve(requiredRoles.some(role => this.roles.includes(role)));\n });\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {ValtimoKeycloakOptions} from '../models';\nimport {Injectable} from '@angular/core';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakOptionsService {\n private readonly valtimoKeycloakOptions: ValtimoKeycloakOptions;\n\n constructor(private configService: ConfigService) {\n this.valtimoKeycloakOptions = configService.config.authentication.options;\n }\n\n get keycloakOptions() {\n return this.valtimoKeycloakOptions.keycloakOptions;\n }\n\n get logoutRedirectUri() {\n return this.valtimoKeycloakOptions.logoutRedirectUri;\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakStorageService {\n getCurrentUrlParams(): string {\n const urlSearchParams = new URLSearchParams(window.location.search);\n const params = Object.fromEntries(urlSearchParams.entries());\n return JSON.stringify(params);\n }\n\n getCurrentUrl(): string {\n return window.location.pathname;\n }\n\n parseSavedParams(savedParams: any): {[key: string]: string} {\n return (\n (savedParams &&\n typeof savedParams === 'string' &&\n savedParams.length > 2 &&\n JSON.parse(savedParams)) ||\n {}\n );\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable, OnDestroy} from '@angular/core';\nimport {combineLatest, map, ReplaySubject, Subject, Subscription, switchMap, timer} from 'rxjs';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakEventType, KeycloakService} from 'keycloak-angular';\nimport {ConfigService, UserIdentity, UserService, ValtimoUserIdentity} from '@valtimo/config';\nimport {KeycloakOptionsService} from './keycloak-options.service';\nimport {jwtDecode} from 'jwt-decode';\nimport {TranslateService} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\nimport {take} from 'rxjs/operators';\nimport {Router} from '@angular/router';\nimport {STORAGE_KEYS} from '../constants';\nimport {KeycloakStorageService} from './keycloak-storage.service';\nimport {PromptService} from '@valtimo/components';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class KeycloakUserService implements UserService, OnDestroy {\n private userIdentity: ReplaySubject<UserIdentity>;\n\n private tokenRefreshSubscription!: Subscription;\n private refreshTokenSubscription!: Subscription;\n private expiryTimerSubscription!: Subscription;\n\n private readonly _refreshToken$ = new Subject<string>();\n\n private _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 user.id\n );\n this.logger.debug('KeycloakUserService: loaded user identity', valtimoUserIdentity);\n this.userIdentity.next(valtimoUserIdentity);\n });\n this.setRefreshToken();\n }\n\n getUserSubject(): ReplaySubject<UserIdentity> {\n this.logger.debug('KeycloakUserService: getUserIdentity');\n return this.userIdentity;\n }\n\n logout(): void {\n this.logger.debug('KeycloakUserService: logout');\n this.keycloakService.logout(this.keycloakOptionsService.logoutRedirectUri);\n }\n\n async getToken(): Promise<string> {\n this.logger.debug('KeycloakUserService: getToken');\n return this.keycloakService.getToken();\n }\n\n async updateToken(minValidity: number): Promise<boolean> {\n this.logger.debug('KeycloakUserService: updateToken');\n return this.keycloakService.updateToken(minValidity);\n }\n\n private openTokenRefreshSubscription(): void {\n this.tokenRefreshSubscription = this.keycloakService.keycloakEvents$.subscribe(\n keycloakEvent => {\n if (keycloakEvent.type === KeycloakEventType.OnAuthRefreshSuccess) {\n this.setRefreshToken();\n }\n }\n );\n }\n\n private openRefreshTokenSubscription(): void {\n this.refreshTokenSubscription = this._refreshToken$.subscribe(refreshToken => {\n const decodedRefreshToken = jwtDecode(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-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './keycloak-auth-guard.service';\nexport * from './keycloak-options.service';\nexport * from './keycloak-user.service';\nexport * from './keycloak-storage.service';\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Component} from '@angular/core';\nimport {Router} from '@angular/router';\nimport {NGXLogger} from 'ngx-logger';\nimport {KeycloakOptionsService, KeycloakStorageService} from './services';\nimport {STORAGE_KEYS} from './constants';\n\n@Component({\n selector: 'valtimo-keycloak-callback',\n template: '',\n})\nexport class CallbackComponent {\n constructor(\n private router: Router,\n private keycloakOptionsService: KeycloakOptionsService,\n private logger: NGXLogger,\n private readonly keycloakStorageService: KeycloakStorageService\n ) {\n logger.debug('callback');\n const savedRedirectTo = window.sessionStorage.getItem(STORAGE_KEYS.redirectTo);\n const savedRedirectToParams = window.sessionStorage.getItem(STORAGE_KEYS.redirectToParams);\n const parsedSavedRedirectToParams =\n this.keycloakStorageService.parseSavedParams(savedRedirectToParams);\n\n const urlBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpiration);\n const paramsBeforeExpiration = sessionStorage.getItem(STORAGE_KEYS.urlBeforeExpirationParams);\n const parsedParamsBeforeExpiration =\n this.keycloakStorageService.parseSavedParams(paramsBeforeExpiration);\n\n let redirectTo!: string;\n\n if (savedRedirectTo) {\n redirectTo = savedRedirectTo;\n } else {\n redirectTo = '/';\n }\n\n logger.debug('keycloak callback redirect =', redirectTo);\n logger.debug('keycloak callback redirect params =', savedRedirectToParams);\n\n if (STORAGE_KEYS.urlBeforeExpiration in sessionStorage) {\n this.router.navigate([urlBeforeExpiration], {queryParams: parsedParamsBeforeExpiration});\n sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpiration);\n sessionStorage.removeItem(STORAGE_KEYS.urlBeforeExpirationParams);\n } else {\n this.router.navigate([redirectTo], {queryParams: parsedSavedRedirectToParams});\n }\n }\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {RouterModule, Routes} from '@angular/router';\nimport {CallbackComponent} from './callback.component';\nimport {CommonModule} from '@angular/common';\n\nconst routes: Routes = [\n {\n path: 'keycloak/callback',\n component: CallbackComponent,\n data: {title: 'Loading...'},\n },\n];\n\n@NgModule({\n imports: [CommonModule, RouterModule.forChild(routes)],\n exports: [RouterModule],\n})\nexport class KeycloakRoutingModule {}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {KeycloakAngularModule} from 'keycloak-angular';\nimport {CallbackComponent} from './callback.component';\nimport {KeycloakRoutingModule} from './keycloak-routing.module';\nimport {TranslateModule} from '@ngx-translate/core';\nimport {DatePipe} from '@angular/common';\n\n@NgModule({\n declarations: [CallbackComponent],\n imports: [KeycloakRoutingModule, KeycloakAngularModule, TranslateModule],\n exports: [CallbackComponent],\n providers: [DatePipe],\n})\nexport class KeycloakModule {}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {KeycloakService} from 'keycloak-angular';\nimport {KeycloakOptionsService, KeycloakStorageService, KeycloakUserService} from './services';\nimport {Injector} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {STORAGE_KEYS} from './constants';\n\nexport function keycloakInitializer(injector: Injector): () => Promise<any> {\n const keycloakService = injector.get<KeycloakService>(KeycloakService);\n const keycloakUserService = injector.get<KeycloakUserService>(KeycloakUserService);\n const optionsService = injector.get<KeycloakOptionsService>(KeycloakOptionsService); // TODO possible removal of abstraction\n const storageService = injector.get<KeycloakStorageService>(KeycloakStorageService);\n const logger = injector.get<NGXLogger>(NGXLogger);\n\n return async (): Promise<any> => {\n try {\n logger.debug('Keycloak initializer before init');\n\n const keycloakOptions = optionsService.keycloakOptions;\n const currentUrl = window.location.href.split('#')[0];\n\n if (keycloakOptions.initOptions.redirectUri !== currentUrl) {\n const redirectTo = storageService.getCurrentUrl();\n logger.debug('Setting redirectTo =', redirectTo);\n window.sessionStorage.setItem(STORAGE_KEYS.redirectTo, redirectTo);\n window.sessionStorage.setItem(\n STORAGE_KEYS.redirectToParams,\n storageService.getCurrentUrlParams()\n );\n }\n\n const initResult = await keycloakService.init(keycloakOptions);\n logger.debug('Keycloak initializer after init');\n\n keycloakUserService.init();\n\n return initResult;\n } catch (error) {\n logger.debug('Keycloak initializer error', error);\n throw error;\n }\n };\n}\n","/*\n * Copyright 2015-2024 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n * Public API Surface of keycloak\n */\n\nexport * from './lib/models';\nexport * from './lib/keycloak.module';\nexport * from './lib/services/keycloak-auth-guard.service';\nexport * from './lib/services/keycloak-user.service';\nexport * from './lib/keycloak.init';\nexport * from './lib/services/keycloak-options.service';\nexport * from './lib/callback.component';\nexport * from './lib/constants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i2.KeycloakOptionsService","i7","i8","i9.KeycloakStorageService","i2.KeycloakStorageService"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;AAEH,MAAM,YAAY,GAAG;AACnB,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,yBAAyB,EAAE,2BAA2B;AACtD,IAAA,UAAU,EAAE,YAAY;AACxB,IAAA,gBAAgB,EAAE,kBAAkB;;;ACpBtC;;;;;;;;;;;;;;AAcG;;ACdH;;;;;;;;;;;;;;AAcG;AAUG,MAAO,wBAAyB,SAAQ,iBAAiB,CAAA;AAC7D,IAAA,WAAA,CACY,MAAc,EACd,eAAgC,EAClC,MAAiB,EAAA;AAEzB,QAAA,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC;QAJpB,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAe,CAAA,eAAA,GAAf,eAAe;QACjB,IAAM,CAAA,MAAA,GAAN,MAAM;AAGd,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC;;IAGrD,eAAe,CAAC,KAA6B,EAAE,KAA0B,EAAA;AACvE,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,2CAA2C,CAAC;QAC9D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACrC,YAAA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AAM,KAAK;;AAEf,KAAC;AACH;;ACzDA;;;;;;;;;;;;;;AAcG;AAEH;;AAEG;;AClBH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@valtimo/keycloak",
3
3
  "license": "EUPL-1.2",
4
- "version": "12.4.0",
4
+ "version": "12.4.2",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^17.2.2",
7
7
  "@angular/core": "^17.2.2"