@igo2/auth 20.1.0-next.2 → 20.1.0-next.21

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,91 +1,52 @@
1
1
  import { AuthService, AuthFeatureKind } from '@igo2/auth';
2
2
  import { ConfigService } from '@igo2/core/config';
3
- import { MsalService, MSAL_GUARD_CONFIG, MsalBroadcastService, MSAL_INSTANCE } from '@azure/msal-angular';
4
- import { PublicClientApplication, InteractionStatus, InteractionRequiredAuthError, WrapperSKU, EventMessageUtils, InteractionType } from '@azure/msal-browser';
3
+ import { MSAL_INSTANCE, MSAL_GUARD_CONFIG, MsalService } from '@azure/msal-angular';
4
+ import { WrapperSKU, InteractionStatus, EventMessageUtils, PublicClientApplication, InteractionRequiredAuthError, LogLevel, BrowserCacheLocation, InteractionType } from '@azure/msal-browser';
5
5
  import * as i0 from '@angular/core';
6
6
  import { inject, ApplicationRef, output, ChangeDetectionStrategy, Component, Injectable } from '@angular/core';
7
7
  import * as i1 from '@angular/material/button';
8
8
  import { MatButtonModule } from '@angular/material/button';
9
- import { MICROSOFT_ICON, IgoIconComponent } from '@igo2/common/icon';
9
+ import { MatError } from '@angular/material/form-field';
10
+ import * as i2 from '@angular/material/icon';
11
+ import { MatIconModule } from '@angular/material/icon';
10
12
  import { IgoLanguageModule } from '@igo2/core/language';
11
- import { Subject, from, BehaviorSubject } from 'rxjs';
13
+ import * as i3 from '@ngx-translate/core';
14
+ import { from, Subject, BehaviorSubject, switchMap, tap, finalize } from 'rxjs';
12
15
  import { filter, takeUntil } from 'rxjs/operators';
13
- import * as i2 from '@ngx-translate/core';
14
16
  import { Location } from '@angular/common';
15
17
 
16
18
  class AuthMicrosoftComponent {
17
- authService = inject(AuthService);
18
- config = inject(ConfigService);
19
+ auth = inject(AuthService);
19
20
  appRef = inject(ApplicationRef);
20
- msalService = inject(MsalService);
21
- msalGuardConfig = inject(MSAL_GUARD_CONFIG);
22
- options;
23
- _destroying$ = new Subject();
24
21
  login = output();
25
- broadcastService;
26
- svgIcon = MICROSOFT_ICON;
27
- constructor() {
28
- this.options = this.config.getConfig('auth.microsoft');
29
- this.msalService.instance = new PublicClientApplication({
30
- auth: this.options,
31
- cache: {
32
- cacheLocation: 'sessionStorage'
33
- }
34
- });
35
- this.broadcastService = new MsalBroadcastService(this.msalService.instance);
36
- if (this.options?.clientId) {
37
- this.broadcastService.inProgress$
38
- .pipe(filter((status) => status === InteractionStatus.None), takeUntil(this._destroying$))
39
- .subscribe(() => {
40
- this.checkAccount();
41
- });
42
- }
43
- else {
44
- console.warn('Microsoft authentification needs "clientId" option');
22
+ error = '';
23
+ ngOnInit() {
24
+ if (this.auth.autoLogin) {
25
+ this.loginUser();
45
26
  }
46
27
  }
47
- loginMicrosoft() {
48
- this.msalService
49
- .loginPopup({ ...this.getConf().authRequest })
50
- .subscribe((response) => {
51
- this.msalService.instance.setActiveAccount(response.account);
52
- this.checkAccount();
53
- });
54
- }
55
- checkAccount() {
56
- this.msalService.instance
57
- .acquireTokenSilent(this.getConf().authRequest)
58
- .then((response) => {
59
- const tokenAccess = response.accessToken;
60
- const tokenId = response.idToken;
61
- this.authService
62
- .loginWithToken(tokenAccess, 'microsoft', { tokenId })
63
- .subscribe(() => {
28
+ loginUser() {
29
+ this.auth.login().subscribe({
30
+ next: () => {
64
31
  this.appRef.tick();
65
32
  this.login.emit(true);
66
- });
67
- })
68
- .catch(async (error) => {
69
- if (error instanceof InteractionRequiredAuthError) {
70
- // fallback to interaction when silent call fails
71
- return this.msalService.acquireTokenPopup(this.getConf().authRequest);
33
+ },
34
+ error: (err) => {
35
+ this.auth
36
+ .translateError('igo.auth.error.microsoft.', err)
37
+ .subscribe((translatedErrorMsg) => {
38
+ this.error = translatedErrorMsg;
39
+ });
72
40
  }
73
- console.log(error);
74
- })
75
- .catch(() => {
76
- console.log('Silent token fails');
77
41
  });
78
42
  }
79
- getConf() {
80
- return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];
81
- }
82
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMicrosoftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
83
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: AuthMicrosoftComponent, isStandalone: true, selector: "igo-auth-microsoft", outputs: { login: "login" }, ngImport: i0, template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoft()\"\n>\n <igo-icon [icon]=\"svgIcon\" />\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}:host>button{height:40px;width:265px}mat-icon{margin-right:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "component", type: IgoIconComponent, selector: "igo-icon", inputs: ["color", "icon"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
43
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthMicrosoftComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
44
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: AuthMicrosoftComponent, isStandalone: true, selector: "igo-auth-microsoft", outputs: { login: "login" }, ngImport: i0, template: "<button class=\"microsoft-login-button\" matButton=\"filled\" (click)=\"loginUser()\">\n <mat-icon\n ><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>Microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n@if (error) {\n <mat-error>{{ error }}</mat-error>\n}\n", styles: [":host{padding:12px 0 0;display:flex;flex-direction:column;gap:16px}mat-icon{margin-right:8px}.auth-microsoft-btn-content{display:flex;align-items:center}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
84
45
  }
85
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMicrosoftComponent, decorators: [{
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthMicrosoftComponent, decorators: [{
86
47
  type: Component,
87
- args: [{ selector: 'igo-auth-microsoft', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent], template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoft()\"\n>\n <igo-icon [icon]=\"svgIcon\" />\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}:host>button{height:40px;width:265px}mat-icon{margin-right:10px}\n"] }]
88
- }], ctorParameters: () => [], propDecorators: { login: [{ type: i0.Output, args: ["login"] }] } });
48
+ args: [{ selector: 'igo-auth-microsoft', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, MatError, MatIconModule, IgoLanguageModule], template: "<button class=\"microsoft-login-button\" matButton=\"filled\" (click)=\"loginUser()\">\n <mat-icon\n ><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>Microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n@if (error) {\n <mat-error>{{ error }}</mat-error>\n}\n", styles: [":host{padding:12px 0 0;display:flex;flex-direction:column;gap:16px}mat-icon{margin-right:8px}.auth-microsoft-btn-content{display:flex;align-items:center}\n"] }]
49
+ }], propDecorators: { login: [{ type: i0.Output, args: ["login"] }] } });
89
50
 
90
51
  /*
91
52
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -153,10 +114,10 @@ class MsalServiceb2c {
153
114
  this.logger = logger.clone(this.name, this.version);
154
115
  this.instance.setLogger(logger);
155
116
  }
156
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
157
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalServiceb2c });
117
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MsalServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
118
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MsalServiceb2c });
158
119
  }
159
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalServiceb2c, decorators: [{
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MsalServiceb2c, decorators: [{
160
121
  type: Injectable
161
122
  }], ctorParameters: () => [] });
162
123
 
@@ -188,10 +149,10 @@ class MsalBroadcastServiceb2c {
188
149
  }
189
150
  });
190
151
  }
191
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalBroadcastServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
192
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalBroadcastServiceb2c });
152
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MsalBroadcastServiceb2c, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
153
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MsalBroadcastServiceb2c });
193
154
  }
194
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MsalBroadcastServiceb2c, decorators: [{
155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: MsalBroadcastServiceb2c, decorators: [{
195
156
  type: Injectable
196
157
  }], ctorParameters: () => [] });
197
158
 
@@ -205,7 +166,6 @@ class AuthMicrosoftb2cComponent {
205
166
  _destroying$ = new Subject();
206
167
  login = output();
207
168
  broadcastService;
208
- svgIcon = MICROSOFT_ICON;
209
169
  constructor() {
210
170
  this.options = this.config.getConfig('auth.microsoftb2c') || {};
211
171
  this.msalService.instance = new PublicClientApplication({
@@ -257,14 +217,54 @@ class AuthMicrosoftb2cComponent {
257
217
  getConf() {
258
218
  return this.msalGuardConfig.filter((conf) => conf.type === 'b2c')[0];
259
219
  }
260
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMicrosoftb2cComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
261
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: AuthMicrosoftb2cComponent, isStandalone: true, selector: "igo-auth-microsoftb2c", outputs: { login: "login" }, providers: [MsalServiceb2c], ngImport: i0, template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoftb2c()\"\n>\n <igo-icon [icon]=\"svgIcon\" />\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}:host>button{height:40px;width:265px}mat-icon{margin-right:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "component", type: IgoIconComponent, selector: "igo-icon", inputs: ["color", "icon"] }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
220
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthMicrosoftb2cComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
221
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: AuthMicrosoftb2cComponent, isStandalone: true, selector: "igo-auth-microsoftb2c", outputs: { login: "login" }, providers: [MsalServiceb2c], ngImport: i0, template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoftb2c()\"\n>\n <mat-icon>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}mat-icon{margin-right:12px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: IgoLanguageModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
262
222
  }
263
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMicrosoftb2cComponent, decorators: [{
223
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthMicrosoftb2cComponent, decorators: [{
264
224
  type: Component,
265
- args: [{ selector: 'igo-auth-microsoftb2c', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent], providers: [MsalServiceb2c], template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoftb2c()\"\n>\n <igo-icon [icon]=\"svgIcon\" />\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}:host>button{height:40px;width:265px}mat-icon{margin-right:10px}\n"] }]
225
+ args: [{ selector: 'igo-auth-microsoftb2c', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, IgoLanguageModule, MatIconModule], providers: [MsalServiceb2c], template: "<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoftb2c()\"\n>\n <mat-icon>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n", styles: [":host{padding:10px 10px 10px 0;display:inline-block;position:relative;top:-15px}mat-icon{margin-right:12px}\n"] }]
266
226
  }], ctorParameters: () => [], propDecorators: { login: [{ type: i0.Output, args: ["login"] }] } });
267
227
 
228
+ class AuthMsalService extends AuthService {
229
+ msalService = inject(MsalService);
230
+ msalGuardConfig = inject(MSAL_GUARD_CONFIG);
231
+ _isInitialized$;
232
+ autoLogin = false;
233
+ constructor() {
234
+ super();
235
+ this.autoLogin = this.authOptions.microsoft?.autoLogin === true;
236
+ this._isInitialized$ = this.msalService.initialize();
237
+ }
238
+ login() {
239
+ this.isLogging.set(true);
240
+ return this._isInitialized$.pipe(switchMap(() => this.msalService.loginPopup(this.getConf().authRequest)), tap(({ account }) => this.msalService.instance.setActiveAccount(account)), switchMap(({ idToken, accessToken }) => this.loginWithToken(accessToken, 'microsoft', { tokenId: idToken }, this.authOptions.microsoft.applicationId)), finalize(() => this.isLogging.set(false)));
241
+ }
242
+ logout() {
243
+ if (this.msalService?.instance?.getActiveAccount()) {
244
+ const logoutRequest = {
245
+ account: this.msalService.instance.getActiveAccount()
246
+ };
247
+ this._isInitialized$
248
+ .pipe(switchMap(() => this.msalService.logoutPopup(logoutRequest)))
249
+ .subscribe(() => super.logout());
250
+ }
251
+ else {
252
+ super.logout();
253
+ }
254
+ }
255
+ getConf() {
256
+ return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];
257
+ }
258
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthMsalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
259
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthMsalService, providedIn: 'root' });
260
+ }
261
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthMsalService, decorators: [{
262
+ type: Injectable,
263
+ args: [{
264
+ providedIn: 'root'
265
+ }]
266
+ }], ctorParameters: () => [] });
267
+
268
268
  const AUTH_MICROSOFT_DIRECTIVES = [
269
269
  AuthMicrosoftComponent,
270
270
  AuthMicrosoftb2cComponent
@@ -277,14 +277,40 @@ function MSALConfigFactory(config) {
277
277
  msConf.redirectUri = msConf?.redirectUri || window.location.href;
278
278
  msConf.authority =
279
279
  msConf?.authority || 'https://login.microsoftonline.com/organizations';
280
- const myMsalObj = new PublicClientApplication({
280
+ const msalInstance = new PublicClientApplication({
281
281
  auth: msConf,
282
282
  cache: {
283
- cacheLocation: 'sessionStorage'
283
+ cacheLocation: BrowserCacheLocation.LocalStorage
284
+ },
285
+ system: {
286
+ loggerOptions: {
287
+ loggerCallback,
288
+ piiLoggingEnabled: false,
289
+ logLevel: LogLevel.Warning
290
+ }
284
291
  }
285
292
  });
286
- return myMsalObj;
293
+ return msalInstance;
287
294
  }
295
+ const loggerCallback = (level, message, containsPii) => {
296
+ if (containsPii) {
297
+ return;
298
+ }
299
+ switch (level) {
300
+ case LogLevel.Error:
301
+ console.error(message);
302
+ break;
303
+ case LogLevel.Info:
304
+ console.info(message);
305
+ break;
306
+ case LogLevel.Verbose:
307
+ console.debug(message);
308
+ break;
309
+ case LogLevel.Warning:
310
+ console.warn(message);
311
+ break;
312
+ }
313
+ };
288
314
  function MSALConfigFactoryb2c(config) {
289
315
  const msConf = config.getConfig('auth.microsoftb2c.browserAuthOptions');
290
316
  if (!msConf) {
@@ -301,12 +327,13 @@ function MSALConfigFactoryb2c(config) {
301
327
  });
302
328
  return myMsalObj;
303
329
  }
304
- function MSALAngularConfigFactory() {
330
+ function MSALAngularConfigFactory(config) {
331
+ const msConf = config.getConfig('auth.microsoft');
305
332
  return {
306
333
  interactionType: InteractionType.Popup,
307
334
  authRequest: {
308
335
  scopes: ['user.read'],
309
- loginHint: 'todo'
336
+ domainHint: msConf?.domainHint || ''
310
337
  },
311
338
  type: 'add'
312
339
  };
@@ -321,7 +348,7 @@ function MSALAngularConfigFactoryb2c(config) {
321
348
  type: 'b2c'
322
349
  };
323
350
  }
324
- function withMicrosoftSupport(type) {
351
+ function withMicrosoftSupport(type, serviceFactory = msalServiceFactory) {
325
352
  if (type === 'b2c') {
326
353
  return {
327
354
  kind: AuthFeatureKind.Microsoft,
@@ -356,15 +383,27 @@ function withMicrosoftSupport(type) {
356
383
  deps: [ConfigService],
357
384
  multi: true
358
385
  },
359
- MsalService
386
+ MsalService,
387
+ {
388
+ provide: AuthService,
389
+ useFactory: serviceFactory,
390
+ deps: [ConfigService]
391
+ }
360
392
  ]
361
393
  };
362
394
  }
363
395
  }
396
+ const msalServiceFactory = (config) => {
397
+ const msConf = config.getConfig('auth.microsoft');
398
+ if (!msConf) {
399
+ return new AuthService();
400
+ }
401
+ return new AuthMsalService();
402
+ };
364
403
 
365
404
  /**
366
405
  * Generated bundle index. Do not edit.
367
406
  */
368
407
 
369
- export { AUTH_MICROSOFT_DIRECTIVES, AuthMicrosoftComponent, AuthMicrosoftb2cComponent, MSALAngularConfigFactory, MSALAngularConfigFactoryb2c, MSALConfigFactory, MSALConfigFactoryb2c, withMicrosoftSupport };
408
+ export { AUTH_MICROSOFT_DIRECTIVES, AuthMicrosoftComponent, AuthMicrosoftb2cComponent, AuthMsalService, MSALAngularConfigFactory, MSALAngularConfigFactoryb2c, MSALConfigFactory, MSALConfigFactoryb2c, withMicrosoftSupport };
370
409
  //# sourceMappingURL=igo2-auth-microsoft.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"igo2-auth-microsoft.mjs","sources":["../../../packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.ts","../../../packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.html","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-msalServiceb2c.service.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-msalBroadcastServiceb2c.service.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.html","../../../packages/auth/microsoft/src/auth-microsoft.provider.ts","../../../packages/auth/microsoft/src/igo2-auth-microsoft.ts"],"sourcesContent":["import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n inject,\n output\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { AuthService } from '@igo2/auth';\nimport { IconSvg, IgoIconComponent, MICROSOFT_ICON } from '@igo2/common/icon';\nimport { ConfigService } from '@igo2/core/config';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport {\n MSAL_GUARD_CONFIG,\n MsalBroadcastService,\n MsalService\n} from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n InteractionRequiredAuthError,\n InteractionStatus,\n PopupRequest,\n PublicClientApplication,\n SilentRequest\n} from '@azure/msal-browser';\nimport { Subject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport {\n AuthMicrosoftOptions,\n MSPMsalGuardConfiguration\n} from '../shared/auth-microsoft.interface';\n\n@Component({\n selector: 'igo-auth-microsoft',\n templateUrl: './auth-microsoft.component.html',\n styleUrls: ['./auth-microsoft.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent]\n})\nexport class AuthMicrosoftComponent {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private appRef = inject(ApplicationRef);\n private msalService = inject(MsalService);\n private msalGuardConfig =\n inject<MSPMsalGuardConfiguration[]>(MSAL_GUARD_CONFIG);\n\n private options?: AuthMicrosoftOptions;\n private readonly _destroying$ = new Subject<void>();\n readonly login = output<boolean>();\n private broadcastService: MsalBroadcastService;\n\n svgIcon: IconSvg = MICROSOFT_ICON;\n\n constructor() {\n this.options = this.config.getConfig('auth.microsoft');\n\n this.msalService.instance = new PublicClientApplication({\n auth: this.options,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n this.broadcastService = new MsalBroadcastService(this.msalService.instance);\n\n if (this.options?.clientId) {\n this.broadcastService.inProgress$\n .pipe(\n filter(\n (status: InteractionStatus) => status === InteractionStatus.None\n ),\n takeUntil(this._destroying$)\n )\n .subscribe(() => {\n this.checkAccount();\n });\n } else {\n console.warn('Microsoft authentification needs \"clientId\" option');\n }\n }\n\n public loginMicrosoft() {\n this.msalService\n .loginPopup({ ...this.getConf().authRequest } as PopupRequest)\n .subscribe((response: AuthenticationResult) => {\n this.msalService.instance.setActiveAccount(response.account);\n this.checkAccount();\n });\n }\n\n private checkAccount() {\n this.msalService.instance\n .acquireTokenSilent(this.getConf().authRequest as SilentRequest)\n .then((response: AuthenticationResult) => {\n const tokenAccess = response.accessToken;\n const tokenId = response.idToken;\n this.authService\n .loginWithToken(tokenAccess, 'microsoft', { tokenId })\n .subscribe(() => {\n this.appRef.tick();\n this.login.emit(true);\n });\n })\n .catch(async (error) => {\n if (error instanceof InteractionRequiredAuthError) {\n // fallback to interaction when silent call fails\n return this.msalService.acquireTokenPopup(\n this.getConf().authRequest as SilentRequest\n );\n }\n console.log(error);\n })\n .catch(() => {\n console.log('Silent token fails');\n });\n }\n\n private getConf(): MSPMsalGuardConfiguration {\n return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];\n }\n}\n","<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoft()\"\n>\n <igo-icon [icon]=\"svgIcon\" />\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { Location } from '@angular/common';\nimport { Injectable, inject } from '@angular/core';\n\nimport { MSAL_INSTANCE } from '@azure/msal-angular';\nimport { IMsalService } from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n EndSessionPopupRequest,\n EndSessionRequest,\n IPublicClientApplication,\n Logger,\n PopupRequest,\n RedirectRequest,\n SilentRequest,\n SsoSilentRequest,\n WrapperSKU\n} from '@azure/msal-browser';\nimport { Observable, from } from 'rxjs';\n\n@Injectable()\nexport class MsalServiceb2c implements IMsalService {\n instance = inject<IPublicClientApplication>(MSAL_INSTANCE);\n private location = inject(Location);\n\n private redirectHash: string;\n private logger: Logger;\n private name = '@azure/msal-angular';\n private version = '2.0.0-beta.2';\n constructor() {\n const hash = this.location.path(true).split('#').pop();\n if (hash) {\n this.redirectHash = `#${hash}`;\n }\n this.instance.initializeWrapperLibrary(WrapperSKU.Angular, this.version);\n }\n\n initialize(): Observable<void> {\n return from(this.instance.initialize());\n }\n\n acquireTokenPopup(request: PopupRequest): Observable<AuthenticationResult> {\n return from(this.instance.acquireTokenPopup(request));\n }\n acquireTokenRedirect(request: RedirectRequest): Observable<void> {\n return from(this.instance.acquireTokenRedirect(request));\n }\n acquireTokenSilent(\n silentRequest: SilentRequest\n ): Observable<AuthenticationResult> {\n return from(this.instance.acquireTokenSilent(silentRequest));\n }\n handleRedirectObservable(hash?: string): Observable<AuthenticationResult> {\n return from(this.instance.handleRedirectPromise(hash || this.redirectHash));\n }\n loginPopup(request?: PopupRequest): Observable<AuthenticationResult> {\n return from(this.instance.loginPopup(request));\n }\n loginRedirect(request?: RedirectRequest): Observable<void> {\n return from(this.instance.loginRedirect(request));\n }\n logout(logoutRequest?: EndSessionRequest): Observable<void> {\n return from(this.instance.logout(logoutRequest));\n }\n logoutRedirect(logoutRequest?: EndSessionRequest): Observable<void> {\n return from(this.instance.logoutRedirect(logoutRequest));\n }\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Observable<void> {\n return from(this.instance.logoutPopup(logoutRequest));\n }\n ssoSilent(request: SsoSilentRequest): Observable<AuthenticationResult> {\n return from(this.instance.ssoSilent(request));\n }\n /**\n * Gets logger for msal-angular.\n * If no logger set, returns logger instance created with same options as msal-browser\n */\n getLogger(): Logger {\n if (!this.logger) {\n this.logger = this.instance.getLogger().clone(this.name, this.version);\n }\n return this.logger;\n }\n // Create a logger instance for msal-angular with the same options as msal-browser\n setLogger(logger: Logger): void {\n this.logger = logger.clone(this.name, this.version);\n this.instance.setLogger(logger);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { Injectable, inject } from '@angular/core';\n\nimport { MSAL_INSTANCE } from '@azure/msal-angular';\nimport {\n EventMessage,\n EventMessageUtils,\n IPublicClientApplication,\n InteractionStatus\n} from '@azure/msal-browser';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\n\nimport { MsalServiceb2c } from './auth-msalServiceb2c.service';\n\n@Injectable()\nexport class MsalBroadcastServiceb2c {\n private msalInstance = inject<IPublicClientApplication>(MSAL_INSTANCE);\n private authService = inject(MsalServiceb2c);\n\n private _msalSubject: Subject<EventMessage>;\n public msalSubject$: Observable<EventMessage>;\n private _inProgress: BehaviorSubject<InteractionStatus>;\n public inProgress$: Observable<InteractionStatus>;\n\n constructor() {\n this._msalSubject = new Subject<EventMessage>();\n this.msalSubject$ = this._msalSubject.asObservable();\n\n // InProgress as BehaviorSubject so most recent inProgress state will be available upon subscription\n this._inProgress = new BehaviorSubject<InteractionStatus>(\n InteractionStatus.Startup\n );\n this.inProgress$ = this._inProgress.asObservable();\n\n this.msalInstance.addEventCallback((message: EventMessage) => {\n this._msalSubject.next(message);\n const status = EventMessageUtils.getInteractionStatusFromEvent(message);\n if (status !== null) {\n this.authService\n .getLogger()\n .verbose(\n `BroadcastService - ${message.eventType} results in setting inProgress to ${status}`\n );\n this._inProgress.next(status);\n }\n });\n }\n}\n","import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n inject,\n output\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport { AuthService } from '@igo2/auth';\nimport { IconSvg, IgoIconComponent, MICROSOFT_ICON } from '@igo2/common/icon';\nimport { ConfigService } from '@igo2/core/config';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { MSAL_GUARD_CONFIG } from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n InteractionRequiredAuthError,\n InteractionStatus,\n PopupRequest,\n PublicClientApplication,\n SilentRequest\n} from '@azure/msal-browser';\nimport { Subject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport {\n AuthMicrosoftb2cOptions,\n MSPMsalGuardConfiguration\n} from '../shared/auth-microsoft.interface';\nimport { MsalBroadcastServiceb2c } from './auth-msalBroadcastServiceb2c.service';\nimport { MsalServiceb2c } from './auth-msalServiceb2c.service';\n\n@Component({\n selector: 'igo-auth-microsoftb2c',\n templateUrl: './auth-microsoftb2c.component.html',\n styleUrls: ['./auth-microsoftb2c.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatButtonModule, IgoLanguageModule, IgoIconComponent],\n providers: [MsalServiceb2c]\n})\nexport class AuthMicrosoftb2cComponent {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private appRef = inject(ApplicationRef);\n private msalService = inject(MsalServiceb2c);\n private msalGuardConfig =\n inject<MSPMsalGuardConfiguration[]>(MSAL_GUARD_CONFIG);\n\n private options: AuthMicrosoftb2cOptions;\n private readonly _destroying$ = new Subject<void>();\n readonly login = output<boolean>();\n private broadcastService: MsalBroadcastServiceb2c;\n\n svgIcon: IconSvg = MICROSOFT_ICON;\n\n constructor() {\n this.options = this.config.getConfig('auth.microsoftb2c') || {};\n\n this.msalService.instance = new PublicClientApplication({\n auth: this.options.browserAuthOptions,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n this.broadcastService = new MsalBroadcastServiceb2c();\n\n if (this.options.browserAuthOptions.clientId) {\n this.broadcastService.inProgress$\n .pipe(\n filter(\n (status: InteractionStatus) => status === InteractionStatus.None\n ),\n takeUntil(this._destroying$)\n )\n .subscribe(() => {\n this.checkAccount();\n });\n } else {\n console.warn('Microsoft authentification needs \"clientId\" option');\n }\n }\n\n public loginMicrosoftb2c() {\n this.msalService\n .loginPopup({ ...this.getConf().authRequest } as PopupRequest)\n .subscribe((response: AuthenticationResult) => {\n this.msalService.instance.setActiveAccount(response.account);\n this.checkAccount();\n });\n }\n\n private checkAccount() {\n this.msalService.instance\n .acquireTokenSilent(this.getConf().authRequest as SilentRequest)\n .then((response: AuthenticationResult) => {\n const token = response.idToken;\n this.authService.loginWithToken(token, 'microsoftb2c').subscribe(() => {\n this.appRef.tick();\n this.login.emit(true);\n });\n })\n .catch(async (error) => {\n if (error instanceof InteractionRequiredAuthError) {\n // fallback to interaction when silent call fails\n return this.msalService.acquireTokenPopup(\n this.getConf().authRequest as SilentRequest\n );\n }\n })\n .catch(() => {\n console.log('Silent token fails');\n });\n }\n\n private getConf(): MSPMsalGuardConfiguration {\n return this.msalGuardConfig.filter((conf) => conf.type === 'b2c')[0];\n }\n}\n","<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoftb2c()\"\n>\n <igo-icon [icon]=\"svgIcon\" />\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n","import { AuthFeature, AuthFeatureKind } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\n\nimport {\n MSAL_GUARD_CONFIG,\n MSAL_INSTANCE,\n MsalService\n} from '@azure/msal-angular';\nimport { InteractionType, PublicClientApplication } from '@azure/msal-browser';\nimport { BrowserAuthOptions } from '@azure/msal-browser';\n\nimport { AuthMicrosoftComponent } from './auth-microsoft/auth-microsoft.component';\nimport { AuthMicrosoftb2cComponent } from './auth-microsoftb2c/auth-microsoftb2c.component';\nimport { MsalServiceb2c } from './auth-microsoftb2c/auth-msalServiceb2c.service';\nimport {\n AuthMicrosoftOptions,\n MSPMsalGuardConfiguration\n} from './shared/auth-microsoft.interface';\n\nexport const AUTH_MICROSOFT_DIRECTIVES = [\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n] as const;\n\nexport function MSALConfigFactory(\n config: ConfigService\n): PublicClientApplication {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n if (!msConf) {\n return;\n }\n\n msConf.redirectUri = msConf?.redirectUri || window.location.href;\n msConf.authority =\n msConf?.authority || 'https://login.microsoftonline.com/organizations';\n\n const myMsalObj = new PublicClientApplication({\n auth: msConf,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n return myMsalObj;\n}\n\nexport function MSALConfigFactoryb2c(\n config: ConfigService\n): PublicClientApplication {\n const msConf = config.getConfig(\n 'auth.microsoftb2c.browserAuthOptions'\n ) as BrowserAuthOptions;\n if (!msConf) {\n return;\n }\n msConf.redirectUri = msConf?.redirectUri || window.location.href;\n msConf.authority =\n msConf?.authority || 'https://login.microsoftonline.com/organizations';\n\n const myMsalObj = new PublicClientApplication({\n auth: msConf,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n return myMsalObj;\n}\n\nexport function MSALAngularConfigFactory(): MSPMsalGuardConfiguration {\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: ['user.read'],\n loginHint: 'todo'\n },\n type: 'add'\n };\n}\n\nexport function MSALAngularConfigFactoryb2c(\n config: ConfigService\n): MSPMsalGuardConfiguration {\n const msConf = config.getConfig(\n 'auth.microsoftb2c.browserAuthOptions'\n ) as BrowserAuthOptions;\n\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: [msConf?.clientId]\n },\n type: 'b2c'\n };\n}\n\nexport function withMicrosoftSupport(\n type?: string\n): AuthFeature<AuthFeatureKind.Microsoft> {\n if (type === 'b2c') {\n return {\n kind: AuthFeatureKind.Microsoft,\n providers: [\n {\n provide: MSAL_INSTANCE,\n useFactory: MSALConfigFactoryb2c,\n deps: [ConfigService]\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useFactory: MSALAngularConfigFactoryb2c,\n deps: [ConfigService],\n multi: true\n },\n MsalServiceb2c\n ]\n };\n } else {\n return {\n kind: AuthFeatureKind.Microsoft,\n providers: [\n {\n provide: MSAL_INSTANCE,\n useFactory: MSALConfigFactory,\n deps: [ConfigService]\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useFactory: MSALAngularConfigFactory,\n deps: [ConfigService],\n multi: true\n },\n MsalService\n ]\n };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MA0Ca,sBAAsB,CAAA;AACzB,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;AAC9B,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AAC/B,IAAA,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;AACjC,IAAA,eAAe,GACrB,MAAM,CAA8B,iBAAiB,CAAC;AAEhD,IAAA,OAAO;AACE,IAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;IAC1C,KAAK,GAAG,MAAM,EAAW;AAC1B,IAAA,gBAAgB;IAExB,OAAO,GAAY,cAAc;AAEjC,IAAA,WAAA,GAAA;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC;AAEtD,QAAA,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,uBAAuB,CAAC;YACtD,IAAI,EAAE,IAAI,CAAC,OAAO;AAClB,YAAA,KAAK,EAAE;AACL,gBAAA,aAAa,EAAE;AAChB;AACF,SAAA,CAAC;AAEF,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,oBAAoB,CAAC,IAAI,CAAC,WAA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aAAa;AACrB,iBAAA;AACD,gBAAA;AACE,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,UAAU,EAAE,wBAAwB;oBACpC,IAAI,EAAE,CAAC,aAAa,CAAC;AACrB,oBAAA,KAAK,EAAE;AACR,iBAAA;gBACD;AACD;SACF;IACH;AACF;;ACxIA;;AAEG;;;;"}
1
+ {"version":3,"file":"igo2-auth-microsoft.mjs","sources":["../../../packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.ts","../../../packages/auth/microsoft/src/auth-microsoft/auth-microsoft.component.html","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-msalServiceb2c.service.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-msalBroadcastServiceb2c.service.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.ts","../../../packages/auth/microsoft/src/auth-microsoftb2c/auth-microsoftb2c.component.html","../../../packages/auth/microsoft/src/shared/auth-msal.service.ts","../../../packages/auth/microsoft/src/auth-microsoft.provider.ts","../../../packages/auth/microsoft/src/igo2-auth-microsoft.ts"],"sourcesContent":["import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n OnInit,\n inject,\n output\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatError } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { AuthService } from '@igo2/auth';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { AuthMsalService } from '../shared/auth-msal.service';\n\n@Component({\n selector: 'igo-auth-microsoft',\n templateUrl: './auth-microsoft.component.html',\n styleUrls: ['./auth-microsoft.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatButtonModule, MatError, MatIconModule, IgoLanguageModule]\n})\nexport class AuthMicrosoftComponent implements OnInit {\n private auth = inject(AuthService) as AuthMsalService;\n private appRef = inject(ApplicationRef);\n\n readonly login = output<boolean>();\n\n error = '';\n\n ngOnInit(): void {\n if (this.auth.autoLogin) {\n this.loginUser();\n }\n }\n\n public loginUser() {\n this.auth.login().subscribe({\n next: () => {\n this.appRef.tick();\n this.login.emit(true);\n },\n error: (err) => {\n this.auth\n .translateError('igo.auth.error.microsoft.', err)\n .subscribe((translatedErrorMsg) => {\n this.error = translatedErrorMsg;\n });\n }\n });\n }\n}\n","<button class=\"microsoft-login-button\" matButton=\"filled\" (click)=\"loginUser()\">\n <mat-icon\n ><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>Microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoft.login' | translate }}\n</button>\n@if (error) {\n <mat-error>{{ error }}</mat-error>\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { Location } from '@angular/common';\nimport { Injectable, inject } from '@angular/core';\n\nimport { MSAL_INSTANCE } from '@azure/msal-angular';\nimport { IMsalService } from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n EndSessionPopupRequest,\n EndSessionRequest,\n IPublicClientApplication,\n Logger,\n PopupRequest,\n RedirectRequest,\n SilentRequest,\n SsoSilentRequest,\n WrapperSKU\n} from '@azure/msal-browser';\nimport { Observable, from } from 'rxjs';\n\n@Injectable()\nexport class MsalServiceb2c implements IMsalService {\n instance = inject<IPublicClientApplication>(MSAL_INSTANCE);\n private location = inject(Location);\n\n private redirectHash: string;\n private logger: Logger;\n private name = '@azure/msal-angular';\n private version = '2.0.0-beta.2';\n constructor() {\n const hash = this.location.path(true).split('#').pop();\n if (hash) {\n this.redirectHash = `#${hash}`;\n }\n this.instance.initializeWrapperLibrary(WrapperSKU.Angular, this.version);\n }\n\n initialize(): Observable<void> {\n return from(this.instance.initialize());\n }\n\n acquireTokenPopup(request: PopupRequest): Observable<AuthenticationResult> {\n return from(this.instance.acquireTokenPopup(request));\n }\n acquireTokenRedirect(request: RedirectRequest): Observable<void> {\n return from(this.instance.acquireTokenRedirect(request));\n }\n acquireTokenSilent(\n silentRequest: SilentRequest\n ): Observable<AuthenticationResult> {\n return from(this.instance.acquireTokenSilent(silentRequest));\n }\n handleRedirectObservable(hash?: string): Observable<AuthenticationResult> {\n return from(this.instance.handleRedirectPromise(hash || this.redirectHash));\n }\n loginPopup(request?: PopupRequest): Observable<AuthenticationResult> {\n return from(this.instance.loginPopup(request));\n }\n loginRedirect(request?: RedirectRequest): Observable<void> {\n return from(this.instance.loginRedirect(request));\n }\n logout(logoutRequest?: EndSessionRequest): Observable<void> {\n return from(this.instance.logout(logoutRequest));\n }\n logoutRedirect(logoutRequest?: EndSessionRequest): Observable<void> {\n return from(this.instance.logoutRedirect(logoutRequest));\n }\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Observable<void> {\n return from(this.instance.logoutPopup(logoutRequest));\n }\n ssoSilent(request: SsoSilentRequest): Observable<AuthenticationResult> {\n return from(this.instance.ssoSilent(request));\n }\n /**\n * Gets logger for msal-angular.\n * If no logger set, returns logger instance created with same options as msal-browser\n */\n getLogger(): Logger {\n if (!this.logger) {\n this.logger = this.instance.getLogger().clone(this.name, this.version);\n }\n return this.logger;\n }\n // Create a logger instance for msal-angular with the same options as msal-browser\n setLogger(logger: Logger): void {\n this.logger = logger.clone(this.name, this.version);\n this.instance.setLogger(logger);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { Injectable, inject } from '@angular/core';\n\nimport { MSAL_INSTANCE } from '@azure/msal-angular';\nimport {\n EventMessage,\n EventMessageUtils,\n IPublicClientApplication,\n InteractionStatus\n} from '@azure/msal-browser';\nimport { BehaviorSubject, Observable, Subject } from 'rxjs';\n\nimport { MsalServiceb2c } from './auth-msalServiceb2c.service';\n\n@Injectable()\nexport class MsalBroadcastServiceb2c {\n private msalInstance = inject<IPublicClientApplication>(MSAL_INSTANCE);\n private authService = inject(MsalServiceb2c);\n\n private _msalSubject: Subject<EventMessage>;\n public msalSubject$: Observable<EventMessage>;\n private _inProgress: BehaviorSubject<InteractionStatus>;\n public inProgress$: Observable<InteractionStatus>;\n\n constructor() {\n this._msalSubject = new Subject<EventMessage>();\n this.msalSubject$ = this._msalSubject.asObservable();\n\n // InProgress as BehaviorSubject so most recent inProgress state will be available upon subscription\n this._inProgress = new BehaviorSubject<InteractionStatus>(\n InteractionStatus.Startup\n );\n this.inProgress$ = this._inProgress.asObservable();\n\n this.msalInstance.addEventCallback((message: EventMessage) => {\n this._msalSubject.next(message);\n const status = EventMessageUtils.getInteractionStatusFromEvent(message);\n if (status !== null) {\n this.authService\n .getLogger()\n .verbose(\n `BroadcastService - ${message.eventType} results in setting inProgress to ${status}`\n );\n this._inProgress.next(status);\n }\n });\n }\n}\n","import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n inject,\n output\n} from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatIconModule } from '@angular/material/icon';\n\nimport { AuthService } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\nimport { IgoLanguageModule } from '@igo2/core/language';\n\nimport { MSAL_GUARD_CONFIG } from '@azure/msal-angular';\nimport {\n AuthenticationResult,\n InteractionRequiredAuthError,\n InteractionStatus,\n PopupRequest,\n PublicClientApplication,\n SilentRequest\n} from '@azure/msal-browser';\nimport { Subject } from 'rxjs';\nimport { filter, takeUntil } from 'rxjs/operators';\n\nimport {\n AuthMicrosoftb2cOptions,\n MsalGuardConfigurationWithType\n} from '../shared/auth-microsoft.interface';\nimport { MsalBroadcastServiceb2c } from './auth-msalBroadcastServiceb2c.service';\nimport { MsalServiceb2c } from './auth-msalServiceb2c.service';\n\n@Component({\n selector: 'igo-auth-microsoftb2c',\n templateUrl: './auth-microsoftb2c.component.html',\n styleUrls: ['./auth-microsoftb2c.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [MatButtonModule, IgoLanguageModule, MatIconModule],\n providers: [MsalServiceb2c]\n})\nexport class AuthMicrosoftb2cComponent {\n private authService = inject(AuthService);\n private config = inject(ConfigService);\n private appRef = inject(ApplicationRef);\n private msalService = inject(MsalServiceb2c);\n private msalGuardConfig =\n inject<MsalGuardConfigurationWithType[]>(MSAL_GUARD_CONFIG);\n\n private options: AuthMicrosoftb2cOptions;\n private readonly _destroying$ = new Subject<void>();\n readonly login = output<boolean>();\n private broadcastService: MsalBroadcastServiceb2c;\n\n constructor() {\n this.options = this.config.getConfig('auth.microsoftb2c') || {};\n\n this.msalService.instance = new PublicClientApplication({\n auth: this.options.browserAuthOptions,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n this.broadcastService = new MsalBroadcastServiceb2c();\n\n if (this.options.browserAuthOptions.clientId) {\n this.broadcastService.inProgress$\n .pipe(\n filter(\n (status: InteractionStatus) => status === InteractionStatus.None\n ),\n takeUntil(this._destroying$)\n )\n .subscribe(() => {\n this.checkAccount();\n });\n } else {\n console.warn('Microsoft authentification needs \"clientId\" option');\n }\n }\n\n public loginMicrosoftb2c() {\n this.msalService\n .loginPopup({ ...this.getConf().authRequest } as PopupRequest)\n .subscribe((response: AuthenticationResult) => {\n this.msalService.instance.setActiveAccount(response.account);\n this.checkAccount();\n });\n }\n\n private checkAccount() {\n this.msalService.instance\n .acquireTokenSilent(this.getConf().authRequest as SilentRequest)\n .then((response: AuthenticationResult) => {\n const token = response.idToken;\n this.authService.loginWithToken(token, 'microsoftb2c').subscribe(() => {\n this.appRef.tick();\n this.login.emit(true);\n });\n })\n .catch(async (error) => {\n if (error instanceof InteractionRequiredAuthError) {\n // fallback to interaction when silent call fails\n return this.msalService.acquireTokenPopup(\n this.getConf().authRequest as SilentRequest\n );\n }\n })\n .catch(() => {\n console.log('Silent token fails');\n });\n }\n\n private getConf(): MsalGuardConfigurationWithType {\n return this.msalGuardConfig.filter((conf) => conf.type === 'b2c')[0];\n }\n}\n","<button\n class=\"microsoft-login-button\"\n matButton=\"elevated\"\n (click)=\"loginMicrosoftb2c()\"\n>\n <mat-icon>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <title>microsoft</title>\n <path\n d=\"M2,3H11V12H2V3M11,22H2V13H11V22M21,3V12H12V3H21M21,22H12V13H21V22Z\"\n />\n </svg>\n </mat-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n","import { Injectable, inject } from '@angular/core';\n\nimport { AuthOptions, AuthService, IUser } from '@igo2/auth';\n\nimport { MSAL_GUARD_CONFIG, MsalService } from '@azure/msal-angular';\nimport { PopupRequest } from '@azure/msal-browser';\nimport { Observable, finalize, switchMap, tap } from 'rxjs';\n\nimport {\n AuthMicrosoftOptions,\n MsalGuardConfigurationWithType\n} from './auth-microsoft.interface';\n\ninterface IAuthMsalOptions extends AuthOptions {\n microsoft: AuthMicrosoftOptions;\n}\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthMsalService extends AuthService<IAuthMsalOptions> {\n private msalService = inject(MsalService);\n private msalGuardConfig =\n inject<MsalGuardConfigurationWithType[]>(MSAL_GUARD_CONFIG);\n\n private _isInitialized$: Observable<void>;\n autoLogin = false;\n\n constructor() {\n super();\n\n this.autoLogin = this.authOptions.microsoft?.autoLogin === true;\n this._isInitialized$ = this.msalService.initialize();\n }\n\n login(): Observable<IUser> {\n this.isLogging.set(true);\n return this._isInitialized$.pipe(\n switchMap(() =>\n this.msalService.loginPopup(this.getConf().authRequest as PopupRequest)\n ),\n tap(({ account }) => this.msalService.instance.setActiveAccount(account)),\n switchMap(({ idToken, accessToken }) =>\n this.loginWithToken(\n accessToken,\n 'microsoft',\n { tokenId: idToken },\n this.authOptions.microsoft.applicationId\n )\n ),\n finalize(() => this.isLogging.set(false))\n );\n }\n\n logout(): void {\n if (this.msalService?.instance?.getActiveAccount()) {\n const logoutRequest = {\n account: this.msalService.instance.getActiveAccount()\n };\n this._isInitialized$\n .pipe(switchMap(() => this.msalService.logoutPopup(logoutRequest)))\n .subscribe(() => super.logout());\n } else {\n super.logout();\n }\n }\n\n private getConf(): MsalGuardConfigurationWithType {\n return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];\n }\n}\n","import { AuthFeature, AuthFeatureKind, AuthService } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\n\nimport {\n MSAL_GUARD_CONFIG,\n MSAL_INSTANCE,\n MsalService\n} from '@azure/msal-angular';\nimport {\n BrowserCacheLocation,\n ILoggerCallback,\n IPublicClientApplication,\n InteractionType,\n LogLevel,\n PublicClientApplication\n} from '@azure/msal-browser';\nimport { BrowserAuthOptions } from '@azure/msal-browser';\n\nimport { AuthMicrosoftComponent } from './auth-microsoft/auth-microsoft.component';\nimport { AuthMicrosoftb2cComponent } from './auth-microsoftb2c/auth-microsoftb2c.component';\nimport { MsalServiceb2c } from './auth-microsoftb2c/auth-msalServiceb2c.service';\nimport {\n AuthMicrosoftOptions,\n MsalGuardConfigurationWithType\n} from './shared/auth-microsoft.interface';\nimport { AuthMsalService } from './shared/auth-msal.service';\n\nexport const AUTH_MICROSOFT_DIRECTIVES = [\n AuthMicrosoftComponent,\n AuthMicrosoftb2cComponent\n] as const;\n\nexport function MSALConfigFactory(\n config: ConfigService\n): IPublicClientApplication {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n if (!msConf) {\n return;\n }\n\n msConf.redirectUri = msConf?.redirectUri || window.location.href;\n msConf.authority =\n msConf?.authority || 'https://login.microsoftonline.com/organizations';\n\n const msalInstance = new PublicClientApplication({\n auth: msConf,\n cache: {\n cacheLocation: BrowserCacheLocation.LocalStorage\n },\n system: {\n loggerOptions: {\n loggerCallback,\n piiLoggingEnabled: false,\n logLevel: LogLevel.Warning\n }\n }\n });\n\n return msalInstance;\n}\n\nconst loggerCallback: ILoggerCallback = (\n level: LogLevel,\n message: string,\n containsPii: boolean\n) => {\n if (containsPii) {\n return;\n }\n switch (level) {\n case LogLevel.Error:\n console.error(message);\n break;\n case LogLevel.Info:\n console.info(message);\n break;\n case LogLevel.Verbose:\n console.debug(message);\n break;\n case LogLevel.Warning:\n console.warn(message);\n break;\n }\n};\n\nexport function MSALConfigFactoryb2c(\n config: ConfigService\n): PublicClientApplication {\n const msConf = config.getConfig(\n 'auth.microsoftb2c.browserAuthOptions'\n ) as BrowserAuthOptions;\n if (!msConf) {\n return;\n }\n msConf.redirectUri = msConf?.redirectUri || window.location.href;\n msConf.authority =\n msConf?.authority || 'https://login.microsoftonline.com/organizations';\n\n const myMsalObj = new PublicClientApplication({\n auth: msConf,\n cache: {\n cacheLocation: 'sessionStorage'\n }\n });\n\n return myMsalObj;\n}\n\nexport function MSALAngularConfigFactory(\n config: ConfigService\n): MsalGuardConfigurationWithType {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: ['user.read'],\n domainHint: msConf?.domainHint || ''\n },\n type: 'add'\n };\n}\n\nexport function MSALAngularConfigFactoryb2c(\n config: ConfigService\n): MsalGuardConfigurationWithType {\n const msConf = config.getConfig(\n 'auth.microsoftb2c.browserAuthOptions'\n ) as BrowserAuthOptions;\n\n return {\n interactionType: InteractionType.Popup,\n authRequest: {\n scopes: [msConf?.clientId]\n },\n type: 'b2c'\n };\n}\n\nexport function withMicrosoftSupport(\n type?: string,\n serviceFactory: IMsalServiceFactory = msalServiceFactory\n): AuthFeature<AuthFeatureKind.Microsoft> {\n if (type === 'b2c') {\n return {\n kind: AuthFeatureKind.Microsoft,\n providers: [\n {\n provide: MSAL_INSTANCE,\n useFactory: MSALConfigFactoryb2c,\n deps: [ConfigService]\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useFactory: MSALAngularConfigFactoryb2c,\n deps: [ConfigService],\n multi: true\n },\n MsalServiceb2c\n ]\n };\n } else {\n return {\n kind: AuthFeatureKind.Microsoft,\n providers: [\n {\n provide: MSAL_INSTANCE,\n useFactory: MSALConfigFactory,\n deps: [ConfigService]\n },\n {\n provide: MSAL_GUARD_CONFIG,\n useFactory: MSALAngularConfigFactory,\n deps: [ConfigService],\n multi: true\n },\n MsalService,\n {\n provide: AuthService,\n useFactory: serviceFactory,\n deps: [ConfigService]\n }\n ]\n };\n }\n}\n\nexport type IMsalServiceFactory = (config: ConfigService) => AuthService;\n\nconst msalServiceFactory: IMsalServiceFactory = (config: ConfigService) => {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n\n if (!msConf) {\n return new AuthService();\n }\n\n return new AuthMsalService();\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAwBa,sBAAsB,CAAA;AACzB,IAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAoB;AAC7C,IAAA,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;IAE9B,KAAK,GAAG,MAAM,EAAW;IAElC,KAAK,GAAG,EAAE;IAEV,QAAQ,GAAA;AACN,QAAA,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACvB,IAAI,CAAC,SAAS,EAAE;QAClB;IACF;IAEO,SAAS,GAAA;AACd,QAAA,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC;YAC1B,IAAI,EAAE,MAAK;AACT,gBAAA,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE;AAClB,gBAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YACvB,CAAC;AACD,YAAA,KAAK,EAAE,CAAC,GAAG,KAAI;AACb,gBAAA,IAAI,CAAC;AACF,qBAAA,cAAc,CAAC,2BAA2B,EAAE,GAAG;AAC/C,qBAAA,SAAS,CAAC,CAAC,kBAAkB,KAAI;AAChC,oBAAA,IAAI,CAAC,KAAK,GAAG,kBAAkB;AACjC,gBAAA,CAAC,CAAC;YACN;AACD,SAAA,CAAC;IACJ;wGA5BW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAA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AACE,oBAAA,OAAO,EAAE,iBAAiB;AAC1B,oBAAA,UAAU,EAAE,wBAAwB;oBACpC,IAAI,EAAE,CAAC,aAAa,CAAC;AACrB,oBAAA,KAAK,EAAE;AACR,iBAAA;gBACD,WAAW;AACX,gBAAA;AACE,oBAAA,OAAO,EAAE,WAAW;AACpB,oBAAA,UAAU,EAAE,cAAc;oBAC1B,IAAI,EAAE,CAAC,aAAa;AACrB;AACF;SACF;IACH;AACF;AAIA,MAAM,kBAAkB,GAAwB,CAAC,MAAqB,KAAI;IACxE,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAyB;IAEzE,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,IAAI,WAAW,EAAE;IAC1B;IAEA,OAAO,IAAI,eAAe,EAAE;AAC9B,CAAC;;ACrMD;;AAEG;;;;"}
@@ -34,10 +34,10 @@ class AuthMonitoringService {
34
34
  break;
35
35
  }
36
36
  }
37
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMonitoringService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
38
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
37
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthMonitoringService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
38
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthMonitoringService, providedIn: 'root' });
39
39
  }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: AuthMonitoringService, decorators: [{
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: AuthMonitoringService, decorators: [{
41
41
  type: Injectable,
42
42
  args: [{
43
43
  providedIn: 'root'
@@ -1 +1 @@
1
- {"version":3,"file":"igo2-auth-monitoring.mjs","sources":["../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.service.ts","../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.provider.ts","../../../packages/auth/monitoring/src/igo2-auth-monitoring.ts"],"sourcesContent":["import { Injectable, Injector, inject } from '@angular/core';\n\nimport { AuthService, User } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS,\n identifySentryUser\n} from '@igo2/core/monitoring';\n\nimport { first, switchMap } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthMonitoringService {\n private configService = inject(ConfigService);\n private monitoringOptions = inject<AnyMonitoringOptions | null>(\n MONITORING_OPTIONS,\n { optional: true }\n );\n private injector = inject(Injector);\n\n // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER\n authService?: AuthService;\n\n constructor() {\n if (!this.monitoringOptions?.identifyUser) {\n return;\n }\n\n this.configService.isLoaded$\n .pipe(\n first((isLoaded) => isLoaded),\n switchMap(() => {\n this.authService = this.injector.get(AuthService);\n return this.authService?.authenticate$;\n })\n )\n .subscribe((isAuthenticated) => {\n const user = isAuthenticated ? this.authService.user : null;\n this._identifyUser(user);\n });\n }\n\n private _identifyUser(user: User | null): void {\n switch (this.monitoringOptions.provider) {\n case 'sentry':\n identifySentryUser(user);\n break;\n\n default:\n break;\n }\n }\n}\n","import {\n EnvironmentProviders,\n Injector,\n Provider,\n inject,\n provideAppInitializer\n} from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS\n} from '@igo2/core/monitoring';\n\nimport { AuthMonitoringService } from './auth-monitoring.service';\n\nexport function provideAuthUserMonitoring(\n options: AnyMonitoringOptions | null\n): (Provider | EnvironmentProviders)[] {\n if (!options) {\n return [];\n }\n\n return [\n {\n provide: AuthMonitoringService,\n useClass: AuthMonitoringService,\n deps: [ConfigService, MONITORING_OPTIONS, Injector]\n },\n // Force instantiate Tracing service to avoid require it in any constructor.\n provideAppInitializer(() => {\n inject(AuthMonitoringService);\n return;\n })\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAea,qBAAqB,CAAA;AACxB,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IACrC,iBAAiB,GAAG,MAAM,CAChC,kBAAkB,EAClB,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB;AACO,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;;AAGnC,IAAA,WAAW;AAEX,IAAA,WAAA,GAAA;AACE,QAAA,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,EAAE;YACzC;QACF;QAEA,IAAI,CAAC,aAAa,CAAC;AAChB,aAAA,IAAI,CACH,KAAK,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAC7B,SAAS,CAAC,MAAK;YACb,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC;AACjD,YAAA,OAAO,IAAI,CAAC,WAAW,EAAE,aAAa;AACxC,QAAA,CAAC,CAAC;AAEH,aAAA,SAAS,CAAC,CAAC,eAAe,KAAI;AAC7B,YAAA,MAAM,IAAI,GAAG,eAAe,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,IAAI;AAC3D,YAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;AAC1B,QAAA,CAAC,CAAC;IACN;AAEQ,IAAA,aAAa,CAAC,IAAiB,EAAA;AACrC,QAAA,QAAQ,IAAI,CAAC,iBAAiB,CAAC,QAAQ;AACrC,YAAA,KAAK,QAAQ;gBACX,kBAAkB,CAAC,IAAI,CAAC;gBACxB;AAEF,YAAA;gBACE;;IAEN;uGAvCW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAArB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cAFpB,MAAM,EAAA,CAAA;;2FAEP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACEK,SAAU,yBAAyB,CACvC,OAAoC,EAAA;IAEpC,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,OAAO,EAAE;IACX;IAEA,OAAO;AACL,QAAA;AACE,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE,qBAAqB;AAC/B,YAAA,IAAI,EAAE,CAAC,aAAa,EAAE,kBAAkB,EAAE,QAAQ;AACnD,SAAA;;QAED,qBAAqB,CAAC,MAAK;YACzB,MAAM,CAAC,qBAAqB,CAAC;YAC7B;AACF,QAAA,CAAC;KACF;AACH;;ACnCA;;AAEG;;;;"}
1
+ {"version":3,"file":"igo2-auth-monitoring.mjs","sources":["../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.service.ts","../../../packages/auth/monitoring/src/auth-monitoring/auth-monitoring.provider.ts","../../../packages/auth/monitoring/src/igo2-auth-monitoring.ts"],"sourcesContent":["import { Injectable, Injector, inject } from '@angular/core';\n\nimport { AuthService, User } from '@igo2/auth';\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS,\n identifySentryUser\n} from '@igo2/core/monitoring';\n\nimport { first, switchMap } from 'rxjs';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthMonitoringService {\n private configService = inject(ConfigService);\n private monitoringOptions = inject<AnyMonitoringOptions | null>(\n MONITORING_OPTIONS,\n { optional: true }\n );\n private injector = inject(Injector);\n\n // The AuthService need to be lazy provided because this service is provided in the APP_INITIALIZER\n authService?: AuthService;\n\n constructor() {\n if (!this.monitoringOptions?.identifyUser) {\n return;\n }\n\n this.configService.isLoaded$\n .pipe(\n first((isLoaded) => isLoaded),\n switchMap(() => {\n this.authService = this.injector.get(AuthService);\n return this.authService?.authenticate$;\n })\n )\n .subscribe((isAuthenticated) => {\n const user = isAuthenticated ? this.authService.user : null;\n this._identifyUser(user);\n });\n }\n\n private _identifyUser(user: User | null): void {\n switch (this.monitoringOptions.provider) {\n case 'sentry':\n identifySentryUser(user);\n break;\n\n default:\n break;\n }\n }\n}\n","import {\n EnvironmentProviders,\n Injector,\n Provider,\n inject,\n provideAppInitializer\n} from '@angular/core';\n\nimport { ConfigService } from '@igo2/core/config';\nimport {\n AnyMonitoringOptions,\n MONITORING_OPTIONS\n} from '@igo2/core/monitoring';\n\nimport { AuthMonitoringService } from './auth-monitoring.service';\n\nexport function provideAuthUserMonitoring(\n options: AnyMonitoringOptions | null\n): (Provider | EnvironmentProviders)[] {\n if (!options) {\n return [];\n }\n\n return [\n {\n provide: AuthMonitoringService,\n useClass: AuthMonitoringService,\n deps: [ConfigService, MONITORING_OPTIONS, Injector]\n },\n // Force instantiate Tracing service to avoid require it in any constructor.\n provideAppInitializer(() => {\n inject(AuthMonitoringService);\n return;\n })\n ];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;MAea,qBAAqB,CAAA;AACxB,IAAA,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;IACrC,iBAAiB,GAAG,MAAM,CAChC,kBAAkB,EAClB,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB;AACO,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;;AAGnC,IAAA,WAAW;AAEX,IAAA,WAAA,GAAA;AACE,QAAA,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,YAAY,EAAE;YACzC;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