@meshmakers/shared-auth 3.2.130-0 → 3.2.133-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -156,10 +156,10 @@ class AuthorizeService {
|
|
|
156
156
|
this.user.next(user);
|
|
157
157
|
this.accessToken.next(accessToken);
|
|
158
158
|
}
|
|
159
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1
|
|
160
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1
|
|
159
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: AuthorizeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
160
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: AuthorizeService });
|
|
161
161
|
}
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1
|
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: AuthorizeService, decorators: [{
|
|
163
163
|
type: Injectable
|
|
164
164
|
}], ctorParameters: () => [] });
|
|
165
165
|
|
|
@@ -195,10 +195,10 @@ class LoginMenuComponent {
|
|
|
195
195
|
this.authorizeService.logout();
|
|
196
196
|
}
|
|
197
197
|
register() { }
|
|
198
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1
|
|
199
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1
|
|
198
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: LoginMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
199
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: LoginMenuComponent, isStandalone: false, selector: "mm-login-menu", ngImport: i0, template: "<ul *ngIf=\"isAuthenticated | async\" class=\"navbar-nav\">\n <li class=\"nav-item dropdown\">\n <a aria-expanded=\"false\" aria-haspopup=\"true\" class=\"nav-link dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\"\n id=\"navbarDropdownLogin\" role=\"button\">\n {{ userName | async }} <b class=\"caret\"></b>\n </a>\n <div aria-labelledby=\"navbarDropdown\" class=\"dropdown-menu\">\n <!--<a class=\"dropdown-item\" asp-action=\"Index\" asp-area=\"Authentication\" asp-controller=\"Grants\">Client Application Access</a>-->\n <!--<a class=\"dropdown-item\" [routerLink]='[\"/authentication/profile\"]' title=\"Manage\">Manage</a>-->\n <!--<a class=\"dropdown-item\" asp-action=\"Index\" asp-area=\"Authentication\" asp-controller=\"Diagnostics\">Diagnostics</a>-->\n <div class=\"dropdown-divider\"></div>\n <a (click)='logout()' class=\"dropdown-item\" routerLink=\"\" title=\"Logout\">Logout</a>\n </div>\n </li>\n</ul>\n<ul *ngIf=\"!(isAuthenticated | async)\" class=\"navbar-nav\">\n <li class=\"nav-item\">\n <a (click)='register()' class=\"nav-link\" routerLink=\"\">Register</a>\n </li>\n <li class=\"nav-item\">\n <a (click)='login()' class=\"nav-link\" routerLink=\"\">Login</a>\n </li>\n</ul>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
200
200
|
}
|
|
201
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1
|
|
201
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: LoginMenuComponent, decorators: [{
|
|
202
202
|
type: Component,
|
|
203
203
|
args: [{ selector: 'mm-login-menu', standalone: false, template: "<ul *ngIf=\"isAuthenticated | async\" class=\"navbar-nav\">\n <li class=\"nav-item dropdown\">\n <a aria-expanded=\"false\" aria-haspopup=\"true\" class=\"nav-link dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\"\n id=\"navbarDropdownLogin\" role=\"button\">\n {{ userName | async }} <b class=\"caret\"></b>\n </a>\n <div aria-labelledby=\"navbarDropdown\" class=\"dropdown-menu\">\n <!--<a class=\"dropdown-item\" asp-action=\"Index\" asp-area=\"Authentication\" asp-controller=\"Grants\">Client Application Access</a>-->\n <!--<a class=\"dropdown-item\" [routerLink]='[\"/authentication/profile\"]' title=\"Manage\">Manage</a>-->\n <!--<a class=\"dropdown-item\" asp-action=\"Index\" asp-area=\"Authentication\" asp-controller=\"Diagnostics\">Diagnostics</a>-->\n <div class=\"dropdown-divider\"></div>\n <a (click)='logout()' class=\"dropdown-item\" routerLink=\"\" title=\"Logout\">Logout</a>\n </div>\n </li>\n</ul>\n<ul *ngIf=\"!(isAuthenticated | async)\" class=\"navbar-nav\">\n <li class=\"nav-item\">\n <a (click)='register()' class=\"nav-link\" routerLink=\"\">Register</a>\n </li>\n <li class=\"nav-item\">\n <a (click)='login()' class=\"nav-link\" routerLink=\"\">Login</a>\n </li>\n</ul>\n" }]
|
|
204
204
|
}], ctorParameters: () => [] });
|
|
@@ -234,10 +234,10 @@ class AuthorizeGuard {
|
|
|
234
234
|
}
|
|
235
235
|
return false;
|
|
236
236
|
}
|
|
237
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1
|
|
238
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1
|
|
237
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: AuthorizeGuard, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
238
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: AuthorizeGuard });
|
|
239
239
|
}
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1
|
|
240
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: AuthorizeGuard, decorators: [{
|
|
241
241
|
type: Injectable
|
|
242
242
|
}] });
|
|
243
243
|
|
|
@@ -255,11 +255,11 @@ class SharedAuthModule {
|
|
|
255
255
|
]
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1
|
|
259
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1
|
|
260
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1
|
|
258
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: SharedAuthModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
259
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.1", ngImport: i0, type: SharedAuthModule, declarations: [LoginMenuComponent], imports: [CommonModule, HttpClientModule, i1$1.OAuthModule, RouterLink], exports: [LoginMenuComponent] });
|
|
260
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: SharedAuthModule, imports: [CommonModule, HttpClientModule, OAuthModule.forRoot()] });
|
|
261
261
|
}
|
|
262
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1
|
|
262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: SharedAuthModule, decorators: [{
|
|
263
263
|
type: NgModule,
|
|
264
264
|
args: [{
|
|
265
265
|
declarations: [LoginMenuComponent],
|
|
@@ -324,10 +324,10 @@ class AuthorizeInterceptor {
|
|
|
324
324
|
// doesn't have the same origin.
|
|
325
325
|
return false;
|
|
326
326
|
}
|
|
327
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1
|
|
328
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1
|
|
327
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: AuthorizeInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
328
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: AuthorizeInterceptor });
|
|
329
329
|
}
|
|
330
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1
|
|
330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: AuthorizeInterceptor, decorators: [{
|
|
331
331
|
type: Injectable
|
|
332
332
|
}], ctorParameters: () => [] });
|
|
333
333
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meshmakers-shared-auth.mjs","sources":["../../../../projects/meshmakers/shared-auth/src/lib/authorize.service.ts","../../../../projects/meshmakers/shared-auth/src/lib/roles.ts","../../../../projects/meshmakers/shared-auth/src/lib/login-menu/login-menu.component.ts","../../../../projects/meshmakers/shared-auth/src/lib/login-menu/login-menu.component.html","../../../../projects/meshmakers/shared-auth/src/lib/authorize.guard.ts","../../../../projects/meshmakers/shared-auth/src/lib/shared-auth.module.ts","../../../../projects/meshmakers/shared-auth/src/lib/authorize.interceptor.ts","../../../../projects/meshmakers/shared-auth/src/public-api.ts","../../../../projects/meshmakers/shared-auth/src/meshmakers-shared-auth.ts"],"sourcesContent":["import { Injectable, inject } from \"@angular/core\";\nimport { BehaviorSubject, firstValueFrom, Observable } from \"rxjs\";\nimport { filter, map } from \"rxjs/operators\";\nimport { AuthConfig, OAuthService } from \"angular-oauth2-oidc\";\nimport { Roles } from \"./roles\";\n\nexport interface IUser {\n name: string;\n role: string[];\n sub: string;\n idp: string;\n email: string | null;\n}\n\nexport class AuthorizeOptions {\n wellKnownServiceUris?: string[];\n // Url of the Identity Provider\n issuer?: string;\n // URL of the SPA to redirect the user to after login\n redirectUri?: string;\n postLogoutRedirectUri?: string;\n // The SPA's id. The SPA is registered with this id at the auth-server\n clientId?: string;\n // set the scope for the permissions the client should request\n // The first three are defined by OIDC. The 4th is a use case-specific one\n scope?: string;\n showDebugInformation?: boolean;\n sessionChecksEnabled?: boolean;\n}\n\n@Injectable()\nexport class AuthorizeService {\n private readonly oauthService = inject(OAuthService);\n\n private readonly isAuthenticated = new BehaviorSubject<boolean>(false);\n private readonly authority: BehaviorSubject<string | null> = new BehaviorSubject<string | null>(null);\n\n private readonly accessToken: BehaviorSubject<string | null> = new BehaviorSubject<string | null>(null);\n\n private readonly user: BehaviorSubject<IUser | null> = new BehaviorSubject<IUser | null>(null);\n\n private readonly isInitialized = new BehaviorSubject<boolean>(false);\n private readonly isInitializing = new BehaviorSubject<boolean>(false);\n\n private authorizeOptions: AuthorizeOptions | null = null;\n\n constructor() {\n console.debug(\"AuthorizeService::created\");\n\n this.getUser().subscribe((s) => {\n this.isAuthenticated.next(!(s == null));\n });\n\n this.oauthService.events.subscribe((e) => {\n console.debug(\"oauth/oidc event\", e);\n });\n\n this.oauthService.events.pipe(filter((e) => e.type === \"session_terminated\")).subscribe((_) => {\n console.debug(\"Your session has been terminated!\");\n });\n\n this.oauthService.events.pipe(filter((e) => e.type === \"token_received\")).subscribe((_) => {\n this.loadUser();\n });\n\n this.oauthService.events.pipe(filter((e) => e.type === \"session_unchanged\")).subscribe((_) => {\n if (this.user.value == null) {\n this.loadUser();\n }\n });\n\n this.oauthService.events.pipe(filter((e) => e.type === \"logout\")).subscribe((_) => {\n this.accessToken.next(null);\n this.user.next(null);\n });\n }\n\n public isInRole(role: Roles): boolean {\n return this.user?.value?.role.includes(role) ?? false;\n }\n\n public getRoles(): Observable<string[]> {\n return this.getUser().pipe(map((u) => (u != null ? u.role : new Array<string>())));\n }\n\n public getServiceUris(): string[] | null {\n return this.authorizeOptions?.wellKnownServiceUris ?? null;\n }\n\n public getAuthority(): Observable<string | null> {\n return this.authority;\n }\n\n public getIsAuthenticated(): Observable<boolean> {\n return this.isAuthenticated;\n }\n\n public getAccessToken(): Observable<string | null> {\n return this.accessToken;\n }\n\n public getUser(): Observable<IUser | null> {\n return this.user;\n }\n\n public login(): void {\n this.oauthService.initImplicitFlow();\n }\n\n public logout(): void {\n this.oauthService.logOut(false);\n }\n\n public async initialize(authorizeOptions: AuthorizeOptions): Promise<void> {\n console.debug(\"AuthorizeService::initialize::started\");\n\n await this.uninitialize();\n\n if (await firstValueFrom(this.isInitializing)) {\n return;\n }\n if (await firstValueFrom(this.isInitialized)) {\n console.debug(\"AuthorizeService::initialize::alreadyInitialized\");\n return;\n }\n this.isInitializing.next(true);\n\n try {\n const config: AuthConfig = {\n responseType: \"code\",\n issuer: authorizeOptions.issuer,\n redirectUri: authorizeOptions.redirectUri,\n postLogoutRedirectUri: authorizeOptions.postLogoutRedirectUri,\n clientId: authorizeOptions.clientId,\n scope: authorizeOptions.scope,\n showDebugInformation: authorizeOptions.showDebugInformation,\n sessionChecksEnabled: authorizeOptions.sessionChecksEnabled,\n preserveRequestedRoute: true\n };\n\n this.authorizeOptions = authorizeOptions;\n\n this.oauthService.configure(config);\n this.oauthService.setStorage(localStorage);\n console.debug(\"AuthorizeService::initialize::loadingDiscoveryDocumentAndTryLogin\");\n await this.oauthService.loadDiscoveryDocumentAndTryLogin();\n\n console.debug(\"AuthorizeService::initialize::setupAutomaticSilentRefresh\");\n this.oauthService.setupAutomaticSilentRefresh();\n\n this.authority.next(authorizeOptions.issuer ?? null);\n\n\n this.isInitialized.next(true);\n console.debug(\"AuthorizeService::initialize::done\");\n }\n finally {\n this.isInitializing.next(false);\n }\n\n console.debug(\"AuthorizeService::initialize::completed\");\n }\n\n public async uninitialize(): Promise<void> {\n console.debug(\"AuthorizeService::uninitialize::started\");\n\n if (await firstValueFrom(this.isInitializing)) {\n return;\n }\n if (!await firstValueFrom(this.isInitialized)) {\n console.debug(\"AuthorizeService::uninitialize::alreadyUninitialized\");\n return;\n }\n\n try {\n this.isInitializing.next(true);\n\n this.oauthService.stopAutomaticRefresh();\n\n this.authorizeOptions = null;\n\n this.isInitialized.next(false);\n console.debug(\"AuthorizeService::uninitialize::done\");\n }\n finally {\n this.isInitializing.next(false);\n }\n\n console.debug(\"AuthorizeService::uninitialize::completed\");\n }\n\n private loadUser(): void {\n const claims = this.oauthService.getIdentityClaims();\n if (!claims) {\n console.error(\"claims where null when loading identity claims\");\n return;\n }\n\n const user = claims as IUser;\n const accessToken = this.oauthService.getAccessToken();\n this.user.next(user);\n this.accessToken.next(accessToken);\n }\n}\n","export enum Roles {\n AdminPanelManagement = 'AdminPanelManagement',\n BotManagement = 'BotManagement',\n UserManagement = 'UserManagement',\n CommunicationManagement = 'CommunicationManagement',\n TenantManagement = 'TenantManagement',\n Development = 'Development'\n}\n","import { Component, OnInit, inject } from '@angular/core';\nimport { AuthorizeService } from '../authorize.service';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\n@Component({\n selector: 'mm-login-menu',\n standalone: false,\n templateUrl: './login-menu.component.html',\n styleUrls: ['./login-menu.component.css']\n})\nexport class LoginMenuComponent implements OnInit {\n private readonly authorizeService = inject(AuthorizeService);\n\n public isAuthenticated: Observable<boolean>;\n public userName: Observable<string | null>;\n\n constructor() {\n this.isAuthenticated = this.authorizeService.getIsAuthenticated();\n this.userName = this.authorizeService.getUser().pipe(map((u) => u?.name ?? null));\n }\n\n ngOnInit(): void {\n const isIFrame = window.self !== window.top;\n\n console.log('app-login-menu::created');\n\n this.isAuthenticated.subscribe((x) => {\n console.log(`isAuthenticated changed to ${x} (iframe ${isIFrame})`);\n });\n }\n\n public login(): void {\n this.authorizeService.login();\n }\n\n public logout(): void {\n this.authorizeService.logout();\n }\n\n public register(): void {}\n}\n","<ul *ngIf=\"isAuthenticated | async\" class=\"navbar-nav\">\n <li class=\"nav-item dropdown\">\n <a aria-expanded=\"false\" aria-haspopup=\"true\" class=\"nav-link dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\"\n id=\"navbarDropdownLogin\" role=\"button\">\n {{ userName | async }} <b class=\"caret\"></b>\n </a>\n <div aria-labelledby=\"navbarDropdown\" class=\"dropdown-menu\">\n <!--<a class=\"dropdown-item\" asp-action=\"Index\" asp-area=\"Authentication\" asp-controller=\"Grants\">Client Application Access</a>-->\n <!--<a class=\"dropdown-item\" [routerLink]='[\"/authentication/profile\"]' title=\"Manage\">Manage</a>-->\n <!--<a class=\"dropdown-item\" asp-action=\"Index\" asp-area=\"Authentication\" asp-controller=\"Diagnostics\">Diagnostics</a>-->\n <div class=\"dropdown-divider\"></div>\n <a (click)='logout()' class=\"dropdown-item\" routerLink=\"\" title=\"Logout\">Logout</a>\n </div>\n </li>\n</ul>\n<ul *ngIf=\"!(isAuthenticated | async)\" class=\"navbar-nav\">\n <li class=\"nav-item\">\n <a (click)='register()' class=\"nav-link\" routerLink=\"\">Register</a>\n </li>\n <li class=\"nav-item\">\n <a (click)='login()' class=\"nav-link\" routerLink=\"\">Login</a>\n </li>\n</ul>\n","import { Injectable, inject } from '@angular/core';\nimport { ActivatedRouteSnapshot, Route, Router, RouterStateSnapshot, UrlSegment, UrlTree } from '@angular/router';\nimport { AuthorizeService } from './authorize.service';\nimport { firstValueFrom, Observable } from 'rxjs';\n\n@Injectable()\nexport class AuthorizeGuard {\n private readonly authorizeService = inject(AuthorizeService);\n private readonly router = inject(Router);\n\n\n canActivate(\n next: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n const url: string = state.url;\n return this.handleAuthorization(next, url);\n }\n\n canActivateChild(\n next: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n return this.canActivate(next, state);\n }\n\n canDeactivate(\n _component: unknown,\n _currentRoute: ActivatedRouteSnapshot,\n _currentState: RouterStateSnapshot,\n _nextState?: RouterStateSnapshot\n ): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n return true;\n }\n\n canLoad(_route: Route, _segments: UrlSegment[]): Observable<boolean> | Promise<boolean> | boolean {\n return true;\n }\n\n private async handleAuthorization(route: ActivatedRouteSnapshot, _url: any): Promise<boolean> {\n const isAuthenticated = await firstValueFrom(this.authorizeService.getIsAuthenticated());\n if (isAuthenticated) {\n const userRoles = await firstValueFrom(this.authorizeService.getRoles());\n if (route.data['roles'] && !route.data['roles'].filter((value: string) => userRoles.includes(value))) {\n await this.router.navigate(['']);\n return false;\n }\n return true;\n } else {\n this.authorizeService.login();\n }\n\n return false;\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HttpClientModule } from '@angular/common/http';\nimport { LoginMenuComponent } from './login-menu/login-menu.component';\nimport { AuthorizeOptions, AuthorizeService } from './authorize.service';\nimport { OAuthModule } from 'angular-oauth2-oidc';\nimport { AuthorizeGuard } from './authorize.guard';\nimport { RouterLink } from '@angular/router';\n\n@NgModule({\n declarations: [LoginMenuComponent],\n exports: [LoginMenuComponent],\n providers: [],\n imports: [CommonModule, HttpClientModule, OAuthModule.forRoot(), RouterLink]\n})\nexport class SharedAuthModule {\n static forRoot(authorizeOptions: AuthorizeOptions): ModuleWithProviders<SharedAuthModule> {\n return {\n ngModule: SharedAuthModule,\n providers: [\n {\n provide: AuthorizeOptions,\n useValue: authorizeOptions\n },\n AuthorizeService,\n AuthorizeGuard\n ]\n };\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { AuthorizeService } from './authorize.service';\n\n@Injectable()\nexport class AuthorizeInterceptor implements HttpInterceptor {\n private readonly authorize = inject(AuthorizeService);\n\n accessToken: string | null;\n\n constructor() {\n const authorize = this.authorize;\n\n this.accessToken = null;\n authorize.getAccessToken().subscribe((value) => (this.accessToken = value));\n }\n\n private static isSameOriginUrl(req: HttpRequest<any>): boolean {\n // It's an absolute url with the same origin.\n if (req.url.startsWith(`${window.location.origin}/`)) {\n return true;\n }\n\n // It's a protocol relative url with the same origin.\n // For example: //www.example.com/api/Products\n if (req.url.startsWith(`//${window.location.host}/`)) {\n return true;\n }\n\n // It's a relative url like /api/Products\n if (/^\\/[^/].*/.test(req.url)) {\n return true;\n }\n\n // It's an absolute or protocol relative url that\n // doesn't have the same origin.\n return false;\n }\n\n // Checks if there is an access_token available in the authorize service\n // and adds it to the request in case it's targeted at the same origin as the\n\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n return this.processRequestWithToken(this.accessToken, req, next);\n }\n\n // single page application.\n private processRequestWithToken(token: string | null, req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n if (!!token && (AuthorizeInterceptor.isSameOriginUrl(req) || this.isKnownServiceUri(req))) {\n req = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`\n }\n });\n }\n\n return next.handle(req);\n }\n\n private isKnownServiceUri(req: any): boolean {\n const serviceUris = this.authorize.getServiceUris();\n\n if (serviceUris != null) {\n for (const serviceUri of serviceUris) {\n if (req.url.startsWith(`${serviceUri}`)) {\n return true;\n }\n }\n }\n\n // It's an absolute or protocol relative url that\n // doesn't have the same origin.\n return false;\n }\n}\n","/*\n * Public API Surface of shared-auth\n */\n\nexport * from './lib/authorize.service';\nexport * from './lib/roles';\nexport * from './lib/login-menu/login-menu.component';\nexport * from './lib/shared-auth.module';\nexport * from './lib/authorize.interceptor';\nexport * from './lib/authorize.guard';\n","/**\n * Generated bundle index. Do not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O,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,CAAC;;;AAI1D,IAAA,uBAAuB,CAAC,KAAoB,EAAE,GAAqB,EAAE,IAAiB,EAAA;QAC5F,IAAI,CAAC,CAAC,KAAK,KAAK,oBAAoB,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,EAAE;AACzF,YAAA,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC;AACd,gBAAA,UAAU,EAAE;oBACV,aAAa,EAAE,CAAA,OAAA,EAAU,KAAK,CAAA;AAC/B;AACF,aAAA,CAAC;;AAGJ,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC;;AAGjB,IAAA,iBAAiB,CAAC,GAAQ,EAAA;QAChC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;AAEnD,QAAA,IAAI,WAAW,IAAI,IAAI,EAAE;AACvB,YAAA,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;gBACpC,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA,EAAG,UAAU,CAAA,CAAE,CAAC,EAAE;AACvC,oBAAA,OAAO,IAAI;;;;;;AAOjB,QAAA,OAAO,KAAK;;uGAnEH,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;2GAApB,oBAAoB,EAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC;;;ACLD;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"meshmakers-shared-auth.mjs","sources":["../../../../projects/meshmakers/shared-auth/src/lib/authorize.service.ts","../../../../projects/meshmakers/shared-auth/src/lib/roles.ts","../../../../projects/meshmakers/shared-auth/src/lib/login-menu/login-menu.component.ts","../../../../projects/meshmakers/shared-auth/src/lib/login-menu/login-menu.component.html","../../../../projects/meshmakers/shared-auth/src/lib/authorize.guard.ts","../../../../projects/meshmakers/shared-auth/src/lib/shared-auth.module.ts","../../../../projects/meshmakers/shared-auth/src/lib/authorize.interceptor.ts","../../../../projects/meshmakers/shared-auth/src/public-api.ts","../../../../projects/meshmakers/shared-auth/src/meshmakers-shared-auth.ts"],"sourcesContent":["import { Injectable, inject } from \"@angular/core\";\nimport { BehaviorSubject, firstValueFrom, Observable } from \"rxjs\";\nimport { filter, map } from \"rxjs/operators\";\nimport { AuthConfig, OAuthService } from \"angular-oauth2-oidc\";\nimport { Roles } from \"./roles\";\n\nexport interface IUser {\n name: string;\n role: string[];\n sub: string;\n idp: string;\n email: string | null;\n}\n\nexport class AuthorizeOptions {\n wellKnownServiceUris?: string[];\n // Url of the Identity Provider\n issuer?: string;\n // URL of the SPA to redirect the user to after login\n redirectUri?: string;\n postLogoutRedirectUri?: string;\n // The SPA's id. The SPA is registered with this id at the auth-server\n clientId?: string;\n // set the scope for the permissions the client should request\n // The first three are defined by OIDC. The 4th is a use case-specific one\n scope?: string;\n showDebugInformation?: boolean;\n sessionChecksEnabled?: boolean;\n}\n\n@Injectable()\nexport class AuthorizeService {\n private readonly oauthService = inject(OAuthService);\n\n private readonly isAuthenticated = new BehaviorSubject<boolean>(false);\n private readonly authority: BehaviorSubject<string | null> = new BehaviorSubject<string | null>(null);\n\n private readonly accessToken: BehaviorSubject<string | null> = new BehaviorSubject<string | null>(null);\n\n private readonly user: BehaviorSubject<IUser | null> = new BehaviorSubject<IUser | null>(null);\n\n private readonly isInitialized = new BehaviorSubject<boolean>(false);\n private readonly isInitializing = new BehaviorSubject<boolean>(false);\n\n private authorizeOptions: AuthorizeOptions | null = null;\n\n constructor() {\n console.debug(\"AuthorizeService::created\");\n\n this.getUser().subscribe((s) => {\n this.isAuthenticated.next(!(s == null));\n });\n\n this.oauthService.events.subscribe((e) => {\n console.debug(\"oauth/oidc event\", e);\n });\n\n this.oauthService.events.pipe(filter((e) => e.type === \"session_terminated\")).subscribe((_) => {\n console.debug(\"Your session has been terminated!\");\n });\n\n this.oauthService.events.pipe(filter((e) => e.type === \"token_received\")).subscribe((_) => {\n this.loadUser();\n });\n\n this.oauthService.events.pipe(filter((e) => e.type === \"session_unchanged\")).subscribe((_) => {\n if (this.user.value == null) {\n this.loadUser();\n }\n });\n\n this.oauthService.events.pipe(filter((e) => e.type === \"logout\")).subscribe((_) => {\n this.accessToken.next(null);\n this.user.next(null);\n });\n }\n\n public isInRole(role: Roles): boolean {\n return this.user?.value?.role.includes(role) ?? false;\n }\n\n public getRoles(): Observable<string[]> {\n return this.getUser().pipe(map((u) => (u != null ? u.role : new Array<string>())));\n }\n\n public getServiceUris(): string[] | null {\n return this.authorizeOptions?.wellKnownServiceUris ?? null;\n }\n\n public getAuthority(): Observable<string | null> {\n return this.authority;\n }\n\n public getIsAuthenticated(): Observable<boolean> {\n return this.isAuthenticated;\n }\n\n public getAccessToken(): Observable<string | null> {\n return this.accessToken;\n }\n\n public getUser(): Observable<IUser | null> {\n return this.user;\n }\n\n public login(): void {\n this.oauthService.initImplicitFlow();\n }\n\n public logout(): void {\n this.oauthService.logOut(false);\n }\n\n public async initialize(authorizeOptions: AuthorizeOptions): Promise<void> {\n console.debug(\"AuthorizeService::initialize::started\");\n\n await this.uninitialize();\n\n if (await firstValueFrom(this.isInitializing)) {\n return;\n }\n if (await firstValueFrom(this.isInitialized)) {\n console.debug(\"AuthorizeService::initialize::alreadyInitialized\");\n return;\n }\n this.isInitializing.next(true);\n\n try {\n const config: AuthConfig = {\n responseType: \"code\",\n issuer: authorizeOptions.issuer,\n redirectUri: authorizeOptions.redirectUri,\n postLogoutRedirectUri: authorizeOptions.postLogoutRedirectUri,\n clientId: authorizeOptions.clientId,\n scope: authorizeOptions.scope,\n showDebugInformation: authorizeOptions.showDebugInformation,\n sessionChecksEnabled: authorizeOptions.sessionChecksEnabled,\n preserveRequestedRoute: true\n };\n\n this.authorizeOptions = authorizeOptions;\n\n this.oauthService.configure(config);\n this.oauthService.setStorage(localStorage);\n console.debug(\"AuthorizeService::initialize::loadingDiscoveryDocumentAndTryLogin\");\n await this.oauthService.loadDiscoveryDocumentAndTryLogin();\n\n console.debug(\"AuthorizeService::initialize::setupAutomaticSilentRefresh\");\n this.oauthService.setupAutomaticSilentRefresh();\n\n this.authority.next(authorizeOptions.issuer ?? null);\n\n\n this.isInitialized.next(true);\n console.debug(\"AuthorizeService::initialize::done\");\n }\n finally {\n this.isInitializing.next(false);\n }\n\n console.debug(\"AuthorizeService::initialize::completed\");\n }\n\n public async uninitialize(): Promise<void> {\n console.debug(\"AuthorizeService::uninitialize::started\");\n\n if (await firstValueFrom(this.isInitializing)) {\n return;\n }\n if (!await firstValueFrom(this.isInitialized)) {\n console.debug(\"AuthorizeService::uninitialize::alreadyUninitialized\");\n return;\n }\n\n try {\n this.isInitializing.next(true);\n\n this.oauthService.stopAutomaticRefresh();\n\n this.authorizeOptions = null;\n\n this.isInitialized.next(false);\n console.debug(\"AuthorizeService::uninitialize::done\");\n }\n finally {\n this.isInitializing.next(false);\n }\n\n console.debug(\"AuthorizeService::uninitialize::completed\");\n }\n\n private loadUser(): void {\n const claims = this.oauthService.getIdentityClaims();\n if (!claims) {\n console.error(\"claims where null when loading identity claims\");\n return;\n }\n\n const user = claims as IUser;\n const accessToken = this.oauthService.getAccessToken();\n this.user.next(user);\n this.accessToken.next(accessToken);\n }\n}\n","export enum Roles {\n AdminPanelManagement = 'AdminPanelManagement',\n BotManagement = 'BotManagement',\n UserManagement = 'UserManagement',\n CommunicationManagement = 'CommunicationManagement',\n TenantManagement = 'TenantManagement',\n Development = 'Development'\n}\n","import { Component, OnInit, inject } from '@angular/core';\nimport { AuthorizeService } from '../authorize.service';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\n@Component({\n selector: 'mm-login-menu',\n standalone: false,\n templateUrl: './login-menu.component.html',\n styleUrls: ['./login-menu.component.css']\n})\nexport class LoginMenuComponent implements OnInit {\n private readonly authorizeService = inject(AuthorizeService);\n\n public isAuthenticated: Observable<boolean>;\n public userName: Observable<string | null>;\n\n constructor() {\n this.isAuthenticated = this.authorizeService.getIsAuthenticated();\n this.userName = this.authorizeService.getUser().pipe(map((u) => u?.name ?? null));\n }\n\n ngOnInit(): void {\n const isIFrame = window.self !== window.top;\n\n console.log('app-login-menu::created');\n\n this.isAuthenticated.subscribe((x) => {\n console.log(`isAuthenticated changed to ${x} (iframe ${isIFrame})`);\n });\n }\n\n public login(): void {\n this.authorizeService.login();\n }\n\n public logout(): void {\n this.authorizeService.logout();\n }\n\n public register(): void {}\n}\n","<ul *ngIf=\"isAuthenticated | async\" class=\"navbar-nav\">\n <li class=\"nav-item dropdown\">\n <a aria-expanded=\"false\" aria-haspopup=\"true\" class=\"nav-link dropdown-toggle\" data-toggle=\"dropdown\" href=\"#\"\n id=\"navbarDropdownLogin\" role=\"button\">\n {{ userName | async }} <b class=\"caret\"></b>\n </a>\n <div aria-labelledby=\"navbarDropdown\" class=\"dropdown-menu\">\n <!--<a class=\"dropdown-item\" asp-action=\"Index\" asp-area=\"Authentication\" asp-controller=\"Grants\">Client Application Access</a>-->\n <!--<a class=\"dropdown-item\" [routerLink]='[\"/authentication/profile\"]' title=\"Manage\">Manage</a>-->\n <!--<a class=\"dropdown-item\" asp-action=\"Index\" asp-area=\"Authentication\" asp-controller=\"Diagnostics\">Diagnostics</a>-->\n <div class=\"dropdown-divider\"></div>\n <a (click)='logout()' class=\"dropdown-item\" routerLink=\"\" title=\"Logout\">Logout</a>\n </div>\n </li>\n</ul>\n<ul *ngIf=\"!(isAuthenticated | async)\" class=\"navbar-nav\">\n <li class=\"nav-item\">\n <a (click)='register()' class=\"nav-link\" routerLink=\"\">Register</a>\n </li>\n <li class=\"nav-item\">\n <a (click)='login()' class=\"nav-link\" routerLink=\"\">Login</a>\n </li>\n</ul>\n","import { Injectable, inject } from '@angular/core';\nimport { ActivatedRouteSnapshot, Route, Router, RouterStateSnapshot, UrlSegment, UrlTree } from '@angular/router';\nimport { AuthorizeService } from './authorize.service';\nimport { firstValueFrom, Observable } from 'rxjs';\n\n@Injectable()\nexport class AuthorizeGuard {\n private readonly authorizeService = inject(AuthorizeService);\n private readonly router = inject(Router);\n\n\n canActivate(\n next: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n const url: string = state.url;\n return this.handleAuthorization(next, url);\n }\n\n canActivateChild(\n next: ActivatedRouteSnapshot,\n state: RouterStateSnapshot\n ): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n return this.canActivate(next, state);\n }\n\n canDeactivate(\n _component: unknown,\n _currentRoute: ActivatedRouteSnapshot,\n _currentState: RouterStateSnapshot,\n _nextState?: RouterStateSnapshot\n ): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {\n return true;\n }\n\n canLoad(_route: Route, _segments: UrlSegment[]): Observable<boolean> | Promise<boolean> | boolean {\n return true;\n }\n\n private async handleAuthorization(route: ActivatedRouteSnapshot, _url: any): Promise<boolean> {\n const isAuthenticated = await firstValueFrom(this.authorizeService.getIsAuthenticated());\n if (isAuthenticated) {\n const userRoles = await firstValueFrom(this.authorizeService.getRoles());\n if (route.data['roles'] && !route.data['roles'].filter((value: string) => userRoles.includes(value))) {\n await this.router.navigate(['']);\n return false;\n }\n return true;\n } else {\n this.authorizeService.login();\n }\n\n return false;\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HttpClientModule } from '@angular/common/http';\nimport { LoginMenuComponent } from './login-menu/login-menu.component';\nimport { AuthorizeOptions, AuthorizeService } from './authorize.service';\nimport { OAuthModule } from 'angular-oauth2-oidc';\nimport { AuthorizeGuard } from './authorize.guard';\nimport { RouterLink } from '@angular/router';\n\n@NgModule({\n declarations: [LoginMenuComponent],\n exports: [LoginMenuComponent],\n providers: [],\n imports: [CommonModule, HttpClientModule, OAuthModule.forRoot(), RouterLink]\n})\nexport class SharedAuthModule {\n static forRoot(authorizeOptions: AuthorizeOptions): ModuleWithProviders<SharedAuthModule> {\n return {\n ngModule: SharedAuthModule,\n providers: [\n {\n provide: AuthorizeOptions,\n useValue: authorizeOptions\n },\n AuthorizeService,\n AuthorizeGuard\n ]\n };\n }\n}\n","import { Injectable, inject } from '@angular/core';\nimport { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { AuthorizeService } from './authorize.service';\n\n@Injectable()\nexport class AuthorizeInterceptor implements HttpInterceptor {\n private readonly authorize = inject(AuthorizeService);\n\n accessToken: string | null;\n\n constructor() {\n const authorize = this.authorize;\n\n this.accessToken = null;\n authorize.getAccessToken().subscribe((value) => (this.accessToken = value));\n }\n\n private static isSameOriginUrl(req: HttpRequest<any>): boolean {\n // It's an absolute url with the same origin.\n if (req.url.startsWith(`${window.location.origin}/`)) {\n return true;\n }\n\n // It's a protocol relative url with the same origin.\n // For example: //www.example.com/api/Products\n if (req.url.startsWith(`//${window.location.host}/`)) {\n return true;\n }\n\n // It's a relative url like /api/Products\n if (/^\\/[^/].*/.test(req.url)) {\n return true;\n }\n\n // It's an absolute or protocol relative url that\n // doesn't have the same origin.\n return false;\n }\n\n // Checks if there is an access_token available in the authorize service\n // and adds it to the request in case it's targeted at the same origin as the\n\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n return this.processRequestWithToken(this.accessToken, req, next);\n }\n\n // single page application.\n private processRequestWithToken(token: string | null, req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\n if (!!token && (AuthorizeInterceptor.isSameOriginUrl(req) || this.isKnownServiceUri(req))) {\n req = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`\n }\n });\n }\n\n return next.handle(req);\n }\n\n private isKnownServiceUri(req: any): boolean {\n const serviceUris = this.authorize.getServiceUris();\n\n if (serviceUris != null) {\n for (const serviceUri of serviceUris) {\n if (req.url.startsWith(`${serviceUri}`)) {\n return true;\n }\n }\n }\n\n // It's an absolute or protocol relative url that\n // doesn't have the same origin.\n return false;\n }\n}\n","/*\n * Public API Surface of shared-auth\n */\n\nexport * from './lib/authorize.service';\nexport * from './lib/roles';\nexport * from './lib/login-menu/login-menu.component';\nexport * from './lib/shared-auth.module';\nexport * from './lib/authorize.interceptor';\nexport * from './lib/authorize.guard';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;MAca,gBAAgB,CAAA;AAC3B,IAAA,oBAAoB;;AAEpB,IAAA,MAAM;;AAEN,IAAA,WAAW;AACX,IAAA,qBAAqB;;AAErB,IAAA,QAAQ;;;AAGR,IAAA,KAAK;AACL,IAAA,oBAAoB;AACpB,IAAA,oBAAoB;AACrB;MAGY,gBAAgB,CAAA;AACV,IAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AAEnC,IAAA,eAAe,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AACrD,IAAA,SAAS,GAAmC,IAAI,eAAe,CAAgB,IAAI,CAAC;AAEpF,IAAA,WAAW,GAAmC,IAAI,eAAe,CAAgB,IAAI,CAAC;AAEtF,IAAA,IAAI,GAAkC,IAAI,eAAe,CAAe,IAAI,CAAC;AAE7E,IAAA,aAAa,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;AACnD,IAAA,cAAc,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC;IAE7D,gBAAgB,GAA4B,IAAI;AAExD,IAAA,WAAA,GAAA;AACE,QAAA,OAAO,CAAC,KAAK,CAAC,2BAA2B,CAAC;QAE1C,IAAI,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,KAAI;AAC7B,YAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC;AACzC,QAAA,CAAC,CAAC;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