@igo2/auth 17.0.0-next.2 → 17.0.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/environment/environment.interface.d.ts +6 -0
  2. package/environment/index.d.ts +5 -0
  3. package/esm2022/environment/environment.interface.mjs +2 -0
  4. package/esm2022/environment/igo2-auth-environment.mjs +5 -0
  5. package/esm2022/environment/public_api.mjs +2 -0
  6. package/esm2022/facebook/auth-facebook/auth-facebook.component.mjs +65 -0
  7. package/esm2022/facebook/igo2-auth-facebook.mjs +5 -0
  8. package/esm2022/facebook/public_api.mjs +3 -0
  9. package/esm2022/facebook/shared/auth-facebook.interface.mjs +2 -0
  10. package/esm2022/facebook/shared/index.mjs +2 -0
  11. package/esm2022/form/auth-form/auth-form.component.mjs +166 -0
  12. package/esm2022/form/auth-form.module.mjs +95 -0
  13. package/esm2022/form/igo2-auth-form.mjs +5 -0
  14. package/esm2022/form/public_api.mjs +9 -0
  15. package/esm2022/form/shared/auth-form.interface.mjs +2 -0
  16. package/esm2022/form/shared/auth-storage.interface.mjs +2 -0
  17. package/esm2022/form/shared/auth-storage.service.mjs +98 -0
  18. package/esm2022/form/shared/index.mjs +4 -0
  19. package/esm2022/google/auth-google/auth-google.component.mjs +108 -0
  20. package/esm2022/google/igo2-auth-google.mjs +5 -0
  21. package/esm2022/google/public_api.mjs +3 -0
  22. package/esm2022/google/shared/auth-google.interface.mjs +2 -0
  23. package/esm2022/google/shared/index.mjs +2 -0
  24. package/esm2022/internal/auth-intern/auth-intern.component.mjs +84 -0
  25. package/esm2022/internal/igo2-auth-internal.mjs +5 -0
  26. package/esm2022/internal/public_api.mjs +2 -0
  27. package/esm2022/lib/shared/auth.interface.mjs +1 -1
  28. package/esm2022/lib/shared/index.mjs +1 -5
  29. package/esm2022/microsoft/auth-microsoft/auth-microsoft.component.mjs +100 -0
  30. package/esm2022/microsoft/auth-microsoft.provider.mjs +92 -0
  31. package/esm2022/microsoft/auth-microsoftb2c/auth-microsoftb2c.component.mjs +98 -0
  32. package/esm2022/microsoft/auth-microsoftb2c/auth-msalBroadcastServiceb2c.service.mjs +47 -0
  33. package/esm2022/microsoft/auth-microsoftb2c/auth-msalServiceb2c.service.mjs +85 -0
  34. package/esm2022/microsoft/igo2-auth-microsoft.mjs +5 -0
  35. package/esm2022/microsoft/public_api.mjs +5 -0
  36. package/esm2022/microsoft/shared/auth-microsoft.interface.mjs +2 -0
  37. package/esm2022/microsoft/shared/index.mjs +2 -0
  38. package/esm2022/public_api.mjs +1 -8
  39. package/{lib/auth-form → facebook/auth-facebook}/auth-facebook.component.d.ts +1 -1
  40. package/facebook/index.d.ts +5 -0
  41. package/facebook/public_api.d.ts +2 -0
  42. package/facebook/shared/auth-facebook.interface.d.ts +4 -0
  43. package/facebook/shared/index.d.ts +1 -0
  44. package/fesm2022/igo2-auth-environment.mjs +4 -0
  45. package/fesm2022/igo2-auth-environment.mjs.map +1 -0
  46. package/fesm2022/igo2-auth-facebook.mjs +70 -0
  47. package/fesm2022/igo2-auth-facebook.mjs.map +1 -0
  48. package/fesm2022/igo2-auth-form.mjs +350 -0
  49. package/fesm2022/igo2-auth-form.mjs.map +1 -0
  50. package/fesm2022/igo2-auth-google.mjs +112 -0
  51. package/fesm2022/igo2-auth-google.mjs.map +1 -0
  52. package/fesm2022/igo2-auth-internal.mjs +89 -0
  53. package/fesm2022/igo2-auth-internal.mjs.map +1 -0
  54. package/fesm2022/igo2-auth-microsoft.mjs +390 -0
  55. package/fesm2022/igo2-auth-microsoft.mjs.map +1 -0
  56. package/fesm2022/igo2-auth.mjs +7 -956
  57. package/fesm2022/igo2-auth.mjs.map +1 -1
  58. package/{lib → form}/auth-form/auth-form.component.d.ts +3 -4
  59. package/form/auth-form.module.d.ts +22 -0
  60. package/form/index.d.ts +5 -0
  61. package/form/public_api.d.ts +5 -0
  62. package/form/shared/auth-form.interface.d.ts +9 -0
  63. package/{lib → form}/shared/auth-storage.service.d.ts +1 -2
  64. package/form/shared/index.d.ts +3 -0
  65. package/{lib/auth-form → google/auth-google}/auth-google.component.d.ts +1 -1
  66. package/google/index.d.ts +5 -0
  67. package/google/public_api.d.ts +2 -0
  68. package/google/shared/auth-google.interface.d.ts +5 -0
  69. package/google/shared/index.d.ts +1 -0
  70. package/{lib/auth-form → internal/auth-intern}/auth-intern.component.d.ts +1 -1
  71. package/internal/index.d.ts +5 -0
  72. package/internal/public_api.d.ts +1 -0
  73. package/lib/shared/auth.interface.d.ts +14 -71
  74. package/lib/shared/index.d.ts +0 -4
  75. package/{lib/auth-form → microsoft/auth-microsoft}/auth-microsoft.component.d.ts +2 -2
  76. package/{lib/shared → microsoft}/auth-microsoft.provider.d.ts +5 -2
  77. package/{lib/auth-form → microsoft/auth-microsoftb2c}/auth-microsoftb2c.component.d.ts +3 -3
  78. package/{lib/shared → microsoft/auth-microsoftb2c}/auth-msalBroadcastServiceb2c.service.d.ts +1 -1
  79. package/microsoft/index.d.ts +5 -0
  80. package/microsoft/public_api.d.ts +4 -0
  81. package/microsoft/shared/auth-microsoft.interface.d.ts +32 -0
  82. package/microsoft/shared/index.d.ts +1 -0
  83. package/package.json +39 -3
  84. package/public_api.d.ts +0 -7
  85. package/src/auth.theme.scss +9 -9
  86. package/esm2022/lib/auth-form/auth-facebook.component.mjs +0 -65
  87. package/esm2022/lib/auth-form/auth-form.component.mjs +0 -170
  88. package/esm2022/lib/auth-form/auth-google.component.mjs +0 -108
  89. package/esm2022/lib/auth-form/auth-intern.component.mjs +0 -84
  90. package/esm2022/lib/auth-form/auth-microsoft.component.mjs +0 -100
  91. package/esm2022/lib/auth-form/auth-microsoftb2c.component.mjs +0 -98
  92. package/esm2022/lib/auth-form/index.mjs +0 -19
  93. package/esm2022/lib/auth.module.mjs +0 -98
  94. package/esm2022/lib/environment/environment.interface.mjs +0 -2
  95. package/esm2022/lib/environment/index.mjs +0 -2
  96. package/esm2022/lib/shared/auth-microsoft.provider.mjs +0 -86
  97. package/esm2022/lib/shared/auth-msalBroadcastServiceb2c.service.mjs +0 -47
  98. package/esm2022/lib/shared/auth-msalServiceb2c.service..mjs +0 -85
  99. package/esm2022/lib/shared/auth-storage.interface.mjs +0 -2
  100. package/esm2022/lib/shared/auth-storage.service.mjs +0 -100
  101. package/esm2022/lib/shared/protected.directive.mjs +0 -21
  102. package/lib/auth-form/index.d.ts +0 -11
  103. package/lib/auth.module.d.ts +0 -24
  104. package/lib/environment/environment.interface.d.ts +0 -5
  105. package/lib/shared/protected.directive.d.ts +0 -8
  106. package/src/lib/auth-form/auth-intern.theme.scss +0 -19
  107. /package/{lib/environment/index.d.ts → environment/public_api.d.ts} +0 -0
  108. /package/{lib → form}/shared/auth-storage.interface.d.ts +0 -0
  109. /package/{lib/shared/auth-msalServiceb2c.service..d.ts → microsoft/auth-microsoftb2c/auth-msalServiceb2c.service.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"igo2-auth-internal.mjs","sources":["../../../packages/auth/internal/src/auth-intern/auth-intern.component.ts","../../../packages/auth/internal/src/auth-intern/auth-intern.component.html","../../../packages/auth/internal/src/igo2-auth-internal.ts"],"sourcesContent":["import { NgIf } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output\n} from '@angular/core';\nimport {\n FormsModule,\n ReactiveFormsModule,\n UntypedFormBuilder,\n UntypedFormGroup,\n Validators\n} from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\n\nimport { AuthService } from '@igo2/auth';\nimport { LanguageService } from '@igo2/core/language';\n\nimport { TranslateModule } from '@ngx-translate/core';\n\n@Component({\n selector: 'igo-auth-intern',\n templateUrl: './auth-intern.component.html',\n styleUrls: ['./auth-intern.component.scss'],\n changeDetection: ChangeDetectionStrategy.Default,\n standalone: true,\n imports: [\n FormsModule,\n ReactiveFormsModule,\n MatFormFieldModule,\n MatInputModule,\n MatButtonModule,\n MatProgressSpinner,\n NgIf,\n TranslateModule\n ]\n})\nexport class AuthInternComponent {\n @Input()\n get allowAnonymous(): boolean {\n return this._allowAnonymous;\n }\n set allowAnonymous(value: boolean) {\n this._allowAnonymous = value;\n }\n private _allowAnonymous = true;\n\n public error = '';\n public form: UntypedFormGroup;\n public loading = false;\n\n @Output() login: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n constructor(\n public auth: AuthService,\n private languageService: LanguageService,\n fb: UntypedFormBuilder\n ) {\n this.form = fb.group({\n username: ['', Validators.required],\n password: ['', Validators.required]\n });\n }\n\n loginUser(values: any) {\n this.loading = true;\n this.auth.login(values.username, values.password).subscribe(\n () => {\n this.login.emit(true);\n this.loading = false;\n },\n (error: any) => {\n try {\n this.languageService.translate\n .get('igo.auth.error.' + error.error.message)\n .subscribe((errorMsg) => (this.error = errorMsg));\n } catch (e) {\n this.error = error.error.message;\n }\n this.loading = false;\n }\n );\n return false;\n }\n\n loginAnonymous() {\n this.auth.loginAnonymous().subscribe(() => {\n this.login.emit(true);\n });\n }\n}\n","<form [formGroup]=\"form\" role=\"form\" (ngSubmit)=\"loginUser(form.value)\">\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.user' | translate }}</mat-label>\n <input\n matInput\n required\n placeholder=\"{{ 'igo.auth.user' | translate }}\"\n formControlName=\"username\"\n />\n </mat-form-field>\n </div>\n\n <div>\n <mat-form-field class=\"full-width\">\n <mat-label>{{ 'igo.auth.password' | translate }}</mat-label>\n <input\n matInput\n required\n type=\"password\"\n placeholder=\"{{ 'igo.auth.password' | translate }}\"\n formControlName=\"password\"\n />\n </mat-form-field>\n </div>\n\n <button mat-raised-button type=\"submit\">\n {{ 'igo.auth.login' | translate }}\n </button>\n <button\n *ngIf=\"allowAnonymous\"\n mat-raised-button\n class=\"anonymous\"\n type=\"button\"\n (click)=\"loginAnonymous()\"\n >\n {{ 'igo.auth.accessAnonymous' | translate }}\n </button>\n <div *ngIf=\"error\">\n <br />\n <font size=\"3\" color=\"red\">{{ error }}</font>\n </div>\n</form>\n\n<div *ngIf=\"loading\" class=\"loading-container\">\n <mat-spinner [diameter]=\"40\"></mat-spinner>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MA0Ca,mBAAmB,CAAA;AAiBrB,IAAA,IAAA,CAAA;AACC,IAAA,eAAA,CAAA;AAjBV,IAAA,IACI,cAAc,GAAA;QAChB,OAAO,IAAI,CAAC,eAAe,CAAC;KAC7B;IACD,IAAI,cAAc,CAAC,KAAc,EAAA;AAC/B,QAAA,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;KAC9B;IACO,eAAe,GAAG,IAAI,CAAC;IAExB,KAAK,GAAG,EAAE,CAAC;AACX,IAAA,IAAI,CAAmB;IACvB,OAAO,GAAG,KAAK,CAAC;AAEb,IAAA,KAAK,GAA0B,IAAI,YAAY,EAAW,CAAC;AAErE,IAAA,WAAA,CACS,IAAiB,EAChB,eAAgC,EACxC,EAAsB,EAAA;QAFf,IAAI,CAAA,IAAA,GAAJ,IAAI,CAAa;QAChB,IAAe,CAAA,eAAA,GAAf,eAAe,CAAiB;AAGxC,QAAA,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC;AACnB,YAAA,QAAQ,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,QAAQ,CAAC;AACnC,YAAA,QAAQ,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,QAAQ,CAAC;AACpC,SAAA,CAAC,CAAC;KACJ;AAED,IAAA,SAAS,CAAC,MAAW,EAAA;AACnB,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;AACpB,QAAA,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CACzD,MAAK;A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EAAA,CAAA;sBADjB,KAAK;gBAaI,KAAK,EAAA,CAAA;sBAAd,MAAM;;;AExDT;;AAEG;;;;"}
@@ -0,0 +1,390 @@
1
+ import * as i2 from '@igo2/core/config';
2
+ import { ConfigService } from '@igo2/core/config';
3
+ import * as i3 from '@azure/msal-angular';
4
+ import { MsalBroadcastService, MSAL_GUARD_CONFIG, MSAL_INSTANCE, MsalService } from '@azure/msal-angular';
5
+ import { PublicClientApplication, InteractionStatus, InteractionRequiredAuthError, WrapperSKU, EventMessageUtils, InteractionType } from '@azure/msal-browser';
6
+ import * as i0 from '@angular/core';
7
+ import { EventEmitter, Component, ChangeDetectionStrategy, Inject, Output, Injectable } from '@angular/core';
8
+ import * as i4 from '@angular/material/button';
9
+ import { MatButtonModule } from '@angular/material/button';
10
+ import * as i5 from '@angular/material/icon';
11
+ import { MatIconModule } from '@angular/material/icon';
12
+ import * as i1 from '@igo2/auth';
13
+ import * as i6 from '@ngx-translate/core';
14
+ import { TranslateModule } from '@ngx-translate/core';
15
+ import { Subject, from, BehaviorSubject } from 'rxjs';
16
+ import { filter, takeUntil } from 'rxjs/operators';
17
+ import * as i1$1 from '@angular/common';
18
+
19
+ class AuthMicrosoftComponent {
20
+ authService;
21
+ config;
22
+ appRef;
23
+ msalService;
24
+ msalGuardConfig;
25
+ options;
26
+ _destroying$ = new Subject();
27
+ login = new EventEmitter();
28
+ broadcastService;
29
+ constructor(authService, config, appRef, msalService, msalGuardConfig) {
30
+ this.authService = authService;
31
+ this.config = config;
32
+ this.appRef = appRef;
33
+ this.msalService = msalService;
34
+ this.msalGuardConfig = msalGuardConfig;
35
+ this.options = this.config.getConfig('auth.microsoft');
36
+ this.msalService.instance = new PublicClientApplication({
37
+ auth: this.options,
38
+ cache: {
39
+ cacheLocation: 'sessionStorage'
40
+ }
41
+ });
42
+ this.broadcastService = new MsalBroadcastService(this.msalService.instance, this.msalService);
43
+ if (this.options?.clientId) {
44
+ this.broadcastService.inProgress$
45
+ .pipe(filter((status) => status === InteractionStatus.None), takeUntil(this._destroying$))
46
+ .subscribe(() => {
47
+ this.checkAccount();
48
+ });
49
+ }
50
+ else {
51
+ console.warn('Microsoft authentification needs "clientId" option');
52
+ }
53
+ }
54
+ loginMicrosoft() {
55
+ this.msalService
56
+ .loginPopup({ ...this.getConf().authRequest })
57
+ .subscribe((response) => {
58
+ this.msalService.instance.setActiveAccount(response.account);
59
+ this.checkAccount();
60
+ });
61
+ }
62
+ checkAccount() {
63
+ this.msalService.instance
64
+ .acquireTokenSilent(this.getConf().authRequest)
65
+ .then((response) => {
66
+ const tokenAccess = response.accessToken;
67
+ const tokenId = response.idToken;
68
+ this.authService
69
+ .loginWithToken(tokenAccess, 'microsoft', { tokenId })
70
+ .subscribe(() => {
71
+ this.appRef.tick();
72
+ this.login.emit(true);
73
+ });
74
+ })
75
+ .catch(async (error) => {
76
+ if (error instanceof InteractionRequiredAuthError) {
77
+ // fallback to interaction when silent call fails
78
+ return this.msalService.acquireTokenPopup(this.getConf().authRequest);
79
+ }
80
+ console.log(error);
81
+ })
82
+ .catch((error) => {
83
+ console.log('Silent token fails');
84
+ });
85
+ }
86
+ getConf() {
87
+ return this.msalGuardConfig.filter((conf) => conf.type === 'add')[0];
88
+ }
89
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMicrosoftComponent, deps: [{ token: i1.AuthService }, { token: i2.ConfigService }, { token: i0.ApplicationRef }, { token: i3.MsalService }, { token: MSAL_GUARD_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
90
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: AuthMicrosoftComponent, isStandalone: true, selector: "igo-auth-microsoft", outputs: { login: "login" }, ngImport: i0, template: "<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoft()\"\n>\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\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{font-size:15px;height:40px;width:265px}mat-icon{margin-right:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
91
+ }
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMicrosoftComponent, decorators: [{
93
+ type: Component,
94
+ args: [{ selector: 'igo-auth-microsoft', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatButtonModule, MatIconModule, TranslateModule], template: "<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoft()\"\n>\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\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{font-size:15px;height:40px;width:265px}mat-icon{margin-right:10px}\n"] }]
95
+ }], ctorParameters: () => [{ type: i1.AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: i3.MsalService }, { type: undefined, decorators: [{
96
+ type: Inject,
97
+ args: [MSAL_GUARD_CONFIG]
98
+ }] }], propDecorators: { login: [{
99
+ type: Output
100
+ }] } });
101
+
102
+ /*
103
+ * Copyright (c) Microsoft Corporation. All rights reserved.
104
+ * Licensed under the MIT License.
105
+ */
106
+ class MsalServiceb2c {
107
+ instance;
108
+ location;
109
+ redirectHash;
110
+ logger;
111
+ name = '@azure/msal-angular';
112
+ version = '2.0.0-beta.2';
113
+ constructor(instance, location) {
114
+ this.instance = instance;
115
+ this.location = location;
116
+ const hash = this.location.path(true).split('#').pop();
117
+ if (hash) {
118
+ this.redirectHash = `#${hash}`;
119
+ }
120
+ this.instance.initializeWrapperLibrary(WrapperSKU.Angular, this.version);
121
+ }
122
+ initialize() {
123
+ return from(this.instance.initialize());
124
+ }
125
+ acquireTokenPopup(request) {
126
+ return from(this.instance.acquireTokenPopup(request));
127
+ }
128
+ acquireTokenRedirect(request) {
129
+ return from(this.instance.acquireTokenRedirect(request));
130
+ }
131
+ acquireTokenSilent(silentRequest) {
132
+ return from(this.instance.acquireTokenSilent(silentRequest));
133
+ }
134
+ handleRedirectObservable(hash) {
135
+ return from(this.instance.handleRedirectPromise(hash || this.redirectHash));
136
+ }
137
+ loginPopup(request) {
138
+ return from(this.instance.loginPopup(request));
139
+ }
140
+ loginRedirect(request) {
141
+ return from(this.instance.loginRedirect(request));
142
+ }
143
+ logout(logoutRequest) {
144
+ return from(this.instance.logout(logoutRequest));
145
+ }
146
+ logoutRedirect(logoutRequest) {
147
+ return from(this.instance.logoutRedirect(logoutRequest));
148
+ }
149
+ logoutPopup(logoutRequest) {
150
+ return from(this.instance.logoutPopup(logoutRequest));
151
+ }
152
+ ssoSilent(request) {
153
+ return from(this.instance.ssoSilent(request));
154
+ }
155
+ /**
156
+ * Gets logger for msal-angular.
157
+ * If no logger set, returns logger instance created with same options as msal-browser
158
+ */
159
+ getLogger() {
160
+ if (!this.logger) {
161
+ this.logger = this.instance.getLogger().clone(this.name, this.version);
162
+ }
163
+ return this.logger;
164
+ }
165
+ // Create a logger instance for msal-angular with the same options as msal-browser
166
+ setLogger(logger) {
167
+ this.logger = logger.clone(this.name, this.version);
168
+ this.instance.setLogger(logger);
169
+ }
170
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: MsalServiceb2c, deps: [{ token: MSAL_INSTANCE }, { token: i1$1.Location }], target: i0.ɵɵFactoryTarget.Injectable });
171
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: MsalServiceb2c });
172
+ }
173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: MsalServiceb2c, decorators: [{
174
+ type: Injectable
175
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
176
+ type: Inject,
177
+ args: [MSAL_INSTANCE]
178
+ }] }, { type: i1$1.Location }] });
179
+
180
+ /*
181
+ * Copyright (c) Microsoft Corporation. All rights reserved.
182
+ * Licensed under the MIT License.
183
+ */
184
+ class MsalBroadcastServiceb2c {
185
+ msalInstance;
186
+ authService;
187
+ _msalSubject;
188
+ msalSubject$;
189
+ _inProgress;
190
+ inProgress$;
191
+ constructor(msalInstance, authService) {
192
+ this.msalInstance = msalInstance;
193
+ this.authService = authService;
194
+ this._msalSubject = new Subject();
195
+ this.msalSubject$ = this._msalSubject.asObservable();
196
+ // InProgress as BehaviorSubject so most recent inProgress state will be available upon subscription
197
+ this._inProgress = new BehaviorSubject(InteractionStatus.Startup);
198
+ this.inProgress$ = this._inProgress.asObservable();
199
+ this.msalInstance.addEventCallback((message) => {
200
+ this._msalSubject.next(message);
201
+ const status = EventMessageUtils.getInteractionStatusFromEvent(message);
202
+ if (status !== null) {
203
+ this.authService
204
+ .getLogger()
205
+ .verbose(`BroadcastService - ${message.eventType} results in setting inProgress to ${status}`);
206
+ this._inProgress.next(status);
207
+ }
208
+ });
209
+ }
210
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: MsalBroadcastServiceb2c, deps: [{ token: MSAL_INSTANCE }, { token: MsalServiceb2c }], target: i0.ɵɵFactoryTarget.Injectable });
211
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: MsalBroadcastServiceb2c });
212
+ }
213
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: MsalBroadcastServiceb2c, decorators: [{
214
+ type: Injectable
215
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
216
+ type: Inject,
217
+ args: [MSAL_INSTANCE]
218
+ }] }, { type: MsalServiceb2c }] });
219
+
220
+ class AuthMicrosoftb2cComponent {
221
+ authService;
222
+ config;
223
+ appRef;
224
+ msalService;
225
+ msalGuardConfig;
226
+ options;
227
+ _destroying$ = new Subject();
228
+ login = new EventEmitter();
229
+ broadcastService;
230
+ constructor(authService, config, appRef, msalService, msalGuardConfig) {
231
+ this.authService = authService;
232
+ this.config = config;
233
+ this.appRef = appRef;
234
+ this.msalService = msalService;
235
+ this.msalGuardConfig = msalGuardConfig;
236
+ this.options = this.config.getConfig('auth.microsoftb2c') || {};
237
+ this.msalService.instance = new PublicClientApplication({
238
+ auth: this.options.browserAuthOptions,
239
+ cache: {
240
+ cacheLocation: 'sessionStorage'
241
+ }
242
+ });
243
+ this.broadcastService = new MsalBroadcastServiceb2c(this.msalService.instance, this.msalService);
244
+ if (this.options.browserAuthOptions.clientId) {
245
+ this.broadcastService.inProgress$
246
+ .pipe(filter((status) => status === InteractionStatus.None), takeUntil(this._destroying$))
247
+ .subscribe(() => {
248
+ this.checkAccount();
249
+ });
250
+ }
251
+ else {
252
+ console.warn('Microsoft authentification needs "clientId" option');
253
+ }
254
+ }
255
+ loginMicrosoftb2c() {
256
+ this.msalService
257
+ .loginPopup({ ...this.getConf().authRequest })
258
+ .subscribe((response) => {
259
+ this.msalService.instance.setActiveAccount(response.account);
260
+ this.checkAccount();
261
+ });
262
+ }
263
+ checkAccount() {
264
+ this.msalService.instance
265
+ .acquireTokenSilent(this.getConf().authRequest)
266
+ .then((response) => {
267
+ const token = response.idToken;
268
+ this.authService.loginWithToken(token, 'microsoftb2c').subscribe(() => {
269
+ this.appRef.tick();
270
+ this.login.emit(true);
271
+ });
272
+ })
273
+ .catch(async (error) => {
274
+ if (error instanceof InteractionRequiredAuthError) {
275
+ // fallback to interaction when silent call fails
276
+ return this.msalService.acquireTokenPopup(this.getConf().authRequest);
277
+ }
278
+ })
279
+ .catch((error) => {
280
+ console.log('Silent token fails');
281
+ });
282
+ }
283
+ getConf() {
284
+ return this.msalGuardConfig.filter((conf) => conf.type === 'b2c')[0];
285
+ }
286
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMicrosoftb2cComponent, deps: [{ token: i1.AuthService }, { token: i2.ConfigService }, { token: i0.ApplicationRef }, { token: MsalServiceb2c }, { token: MSAL_GUARD_CONFIG }], target: i0.ɵɵFactoryTarget.Component });
287
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: AuthMicrosoftb2cComponent, isStandalone: true, selector: "igo-auth-microsoftb2c", outputs: { login: "login" }, providers: [MsalServiceb2c], ngImport: i0, template: "<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoftb2c()\"\n>\n <mat-icon svgIcon=\"microsoft\"></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}:host>button{font-size:15px;height:40px;width:265px}mat-icon{margin-right:10px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
288
+ }
289
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: AuthMicrosoftb2cComponent, decorators: [{
290
+ type: Component,
291
+ args: [{ selector: 'igo-auth-microsoftb2c', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [MatButtonModule, MatIconModule, TranslateModule], providers: [MsalServiceb2c], template: "<button\n class=\"microsoft-login-button\"\n mat-raised-button\n (click)=\"loginMicrosoftb2c()\"\n>\n <mat-icon svgIcon=\"microsoft\"></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}:host>button{font-size:15px;height:40px;width:265px}mat-icon{margin-right:10px}\n"] }]
292
+ }], ctorParameters: () => [{ type: i1.AuthService }, { type: i2.ConfigService }, { type: i0.ApplicationRef }, { type: MsalServiceb2c }, { type: undefined, decorators: [{
293
+ type: Inject,
294
+ args: [MSAL_GUARD_CONFIG]
295
+ }] }], propDecorators: { login: [{
296
+ type: Output
297
+ }] } });
298
+
299
+ const AUTH_MICROSOFT_DIRECTIVES = [
300
+ AuthMicrosoftComponent,
301
+ AuthMicrosoftb2cComponent
302
+ ];
303
+ function MSALConfigFactory(config) {
304
+ const msConf = config.getConfig('auth.microsoft');
305
+ msConf.redirectUri = msConf?.redirectUri || window.location.href;
306
+ msConf.authority =
307
+ msConf?.authority || 'https://login.microsoftonline.com/organizations';
308
+ const myMsalObj = new PublicClientApplication({
309
+ auth: msConf,
310
+ cache: {
311
+ cacheLocation: 'sessionStorage'
312
+ }
313
+ });
314
+ return myMsalObj;
315
+ }
316
+ function MSALConfigFactoryb2c(config) {
317
+ const msConf = config.getConfig('auth.microsoftb2c.browserAuthOptions');
318
+ msConf.redirectUri = msConf?.redirectUri || window.location.href;
319
+ msConf.authority =
320
+ msConf?.authority || 'https://login.microsoftonline.com/organizations';
321
+ const myMsalObj = new PublicClientApplication({
322
+ auth: msConf,
323
+ cache: {
324
+ cacheLocation: 'sessionStorage'
325
+ }
326
+ });
327
+ return myMsalObj;
328
+ }
329
+ function MSALAngularConfigFactory(config) {
330
+ const msConf = config.getConfig('auth.microsoft');
331
+ return {
332
+ interactionType: InteractionType.Popup,
333
+ authRequest: {
334
+ scopes: ['user.read'],
335
+ loginHint: 'todo'
336
+ },
337
+ type: 'add'
338
+ };
339
+ }
340
+ function MSALAngularConfigFactoryb2c(config) {
341
+ const msConf = config.getConfig('auth.microsoftb2c.browserAuthOptions');
342
+ return {
343
+ interactionType: InteractionType.Popup,
344
+ authRequest: {
345
+ scopes: [msConf?.clientId]
346
+ },
347
+ type: 'b2c'
348
+ };
349
+ }
350
+ function provideAuthMicrosoft(type) {
351
+ if (type === 'b2c') {
352
+ return [
353
+ {
354
+ provide: MSAL_INSTANCE,
355
+ useFactory: MSALConfigFactoryb2c,
356
+ deps: [ConfigService]
357
+ },
358
+ {
359
+ provide: MSAL_GUARD_CONFIG,
360
+ useFactory: MSALAngularConfigFactoryb2c,
361
+ deps: [ConfigService],
362
+ multi: true
363
+ },
364
+ MsalServiceb2c
365
+ ];
366
+ }
367
+ else {
368
+ return [
369
+ {
370
+ provide: MSAL_INSTANCE,
371
+ useFactory: MSALConfigFactory,
372
+ deps: [ConfigService]
373
+ },
374
+ {
375
+ provide: MSAL_GUARD_CONFIG,
376
+ useFactory: MSALAngularConfigFactory,
377
+ deps: [ConfigService],
378
+ multi: true
379
+ },
380
+ MsalService
381
+ ];
382
+ }
383
+ }
384
+
385
+ /**
386
+ * Generated bundle index. Do not edit.
387
+ */
388
+
389
+ export { AUTH_MICROSOFT_DIRECTIVES, AuthMicrosoftComponent, AuthMicrosoftb2cComponent, MSALAngularConfigFactory, MSALAngularConfigFactoryb2c, MSALConfigFactory, MSALConfigFactoryb2c, provideAuthMicrosoft };
390
+ //# sourceMappingURL=igo2-auth-microsoft.mjs.map
@@ -0,0 +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 EventEmitter,\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';\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 { TranslateModule } from '@ngx-translate/core';\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 standalone: true,\n imports: [MatButtonModule, MatIconModule, TranslateModule]\n})\nexport class AuthMicrosoftComponent {\n private options?: AuthMicrosoftOptions;\n private readonly _destroying$ = new Subject<void>();\n @Output() login: EventEmitter<boolean> = new EventEmitter<boolean>();\n private broadcastService: MsalBroadcastService;\n\n constructor(\n private authService: AuthService,\n private config: ConfigService,\n private appRef: ApplicationRef,\n private msalService: MsalService,\n @Inject(MSAL_GUARD_CONFIG)\n private msalGuardConfig: MSPMsalGuardConfiguration[]\n ) {\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(\n this.msalService.instance,\n this.msalService\n );\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((error) => {\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 mat-raised-button\n (click)=\"loginMicrosoft()\"\n>\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\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 { Inject, Injectable } 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 private redirectHash: string;\n private logger: Logger;\n private name = '@azure/msal-angular';\n private version = '2.0.0-beta.2';\n constructor(\n @Inject(MSAL_INSTANCE) public instance: IPublicClientApplication,\n private location: Location\n ) {\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 { Inject, Injectable } 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 _msalSubject: Subject<EventMessage>;\n public msalSubject$: Observable<EventMessage>;\n private _inProgress: BehaviorSubject<InteractionStatus>;\n public inProgress$: Observable<InteractionStatus>;\n\n constructor(\n @Inject(MSAL_INSTANCE) private msalInstance: IPublicClientApplication,\n private authService: MsalServiceb2c\n ) {\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 EventEmitter,\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';\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 { TranslateModule } from '@ngx-translate/core';\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 standalone: true,\n imports: [MatButtonModule, MatIconModule, TranslateModule],\n providers: [MsalServiceb2c]\n})\nexport class AuthMicrosoftb2cComponent {\n private options: AuthMicrosoftb2cOptions;\n private readonly _destroying$ = new Subject<void>();\n @Output() login: EventEmitter<boolean> = new EventEmitter<boolean>();\n private broadcastService: MsalBroadcastServiceb2c;\n\n constructor(\n private authService: AuthService,\n private config: ConfigService,\n private appRef: ApplicationRef,\n private msalService: MsalServiceb2c,\n @Inject(MSAL_GUARD_CONFIG)\n private msalGuardConfig: MSPMsalGuardConfiguration[]\n ) {\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 this.msalService.instance,\n this.msalService\n );\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((error) => {\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 mat-raised-button\n (click)=\"loginMicrosoftb2c()\"\n>\n <mat-icon svgIcon=\"microsoft\"></mat-icon>\n {{ 'igo.auth.microsoftb2c.login' | translate }}\n</button>\n","import { 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\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 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): MSPMsalGuardConfiguration {\n const msConf = config.getConfig('auth.microsoft') as AuthMicrosoftOptions;\n\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 provideAuthMicrosoft(type?: string) {\n if (type === 'b2c') {\n return [\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 } else {\n return [\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 * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1","i1.MsalServiceb2c"],"mappings":";;;;;;;;;;;;;;;;;;MA4Ca,sBAAsB,CAAA;AAOvB,IAAA,WAAA,CAAA;AACA,IAAA,MAAA,CAAA;AACA,IAAA,MAAA,CAAA;AACA,IAAA,WAAA,CAAA;AAEA,IAAA,eAAA,CAAA;AAXF,IAAA,OAAO,CAAwB;AACtB,IAAA,YAAY,GAAG,IAAI,OAAO,EAAQ,CAAC;AAC1C,IAAA,KAAK,GAA0B,IAAI,YAAY,EAAW,CAAC;AAC7D,IAAA,gBAAgB,CAAuB;IAE/C,WACU,CAAA,WAAwB,EACxB,MAAqB,EACrB,MAAsB,EACtB,WAAwB,EAExB,eAA4C,EAAA;QAL5C,IAAW,CAAA,WAAA,GAAX,WAAW,CAAa;QACxB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAe;QACrB,IAAM,CAAA,MAAA,GAAN,MAAM,CAAgB;QACtB,IAAW,CAAA,WAAA,GAAX,WAAW,CAAa;QAExB,IAAe,CAAA,eAAA,GAAf,eAAe,CAA6B;QAEpD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;AAEvD,QAAA,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,uBAAuB,CAAC;YACtD,IAAI,EAAE,IAAI,CAAC,OAAO;AAClB,YAAA,KAAK,EAAE;AACL,gBAAA,aAAa,EAAE,gBAAgB;AAChC,aAAA;AACF,SAAA,CAAC,CAAC;AAEH,QAAA,IAAI,CAAC,gBAAgB,GAAG,IAAI,oBAAoB,CAC9C,IAAI,CAAC,WAAW,CAAC,QAAQ,EACzB,IAAI,CAAC,WAAW,CACjB,CAAC;AAEF,QAAA,IAAI,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE;YA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