@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,25 +1,18 @@
1
- import { AuthFeature, AuthFeatureKind } from '@igo2/auth';
1
+ import { AuthService, AuthFeature, AuthFeatureKind, AuthOptions, IUser } from '@igo2/auth';
2
2
  import { ConfigService } from '@igo2/core/config';
3
- import { BrowserAuthOptions, PublicClientApplication } from '@azure/msal-browser';
3
+ import { BrowserAuthOptions, IPublicClientApplication, PublicClientApplication } from '@azure/msal-browser';
4
4
  import * as i0 from '@angular/core';
5
- import { IconSvg } from '@igo2/common/icon';
5
+ import { OnInit } from '@angular/core';
6
6
  import { MsalGuardConfiguration } from '@azure/msal-angular';
7
+ import { Observable } from 'rxjs';
7
8
 
8
- declare class AuthMicrosoftComponent {
9
- private authService;
10
- private config;
9
+ declare class AuthMicrosoftComponent implements OnInit {
10
+ private auth;
11
11
  private appRef;
12
- private msalService;
13
- private msalGuardConfig;
14
- private options?;
15
- private readonly _destroying$;
16
12
  readonly login: i0.OutputEmitterRef<boolean>;
17
- private broadcastService;
18
- svgIcon: IconSvg;
19
- constructor();
20
- loginMicrosoft(): void;
21
- private checkAccount;
22
- private getConf;
13
+ error: string;
14
+ ngOnInit(): void;
15
+ loginUser(): void;
23
16
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthMicrosoftComponent, never>;
24
17
  static ɵcmp: i0.ɵɵComponentDeclaration<AuthMicrosoftComponent, "igo-auth-microsoft", never, {}, { "login": "login"; }, never, never, true, never>;
25
18
  }
@@ -34,7 +27,6 @@ declare class AuthMicrosoftb2cComponent {
34
27
  private readonly _destroying$;
35
28
  readonly login: i0.OutputEmitterRef<boolean>;
36
29
  private broadcastService;
37
- svgIcon: IconSvg;
38
30
  constructor();
39
31
  loginMicrosoftb2c(): void;
40
32
  private checkAccount;
@@ -45,6 +37,9 @@ declare class AuthMicrosoftb2cComponent {
45
37
 
46
38
  interface AuthMicrosoftOptions extends BrowserAuthOptions {
47
39
  enabled?: boolean;
40
+ autoLogin?: boolean;
41
+ domainHint?: string;
42
+ applicationId?: string;
48
43
  }
49
44
  interface AuthMicrosoftb2cOptions {
50
45
  enabled?: boolean;
@@ -70,16 +65,36 @@ interface AuthMicrosoftb2cOptionsAuthorities {
70
65
  interface AuthMicrosoftb2cOptionsAuthority {
71
66
  authority: string;
72
67
  }
73
- interface MSPMsalGuardConfiguration extends MsalGuardConfiguration {
68
+ interface MsalGuardConfigurationWithType extends MsalGuardConfiguration {
69
+ type: string;
70
+ }
71
+ interface MsalGuardConfigurationWithType extends MsalGuardConfiguration {
74
72
  type: string;
75
73
  }
76
74
 
77
75
  declare const AUTH_MICROSOFT_DIRECTIVES: readonly [typeof AuthMicrosoftComponent, typeof AuthMicrosoftb2cComponent];
78
- declare function MSALConfigFactory(config: ConfigService): PublicClientApplication;
76
+ declare function MSALConfigFactory(config: ConfigService): IPublicClientApplication;
79
77
  declare function MSALConfigFactoryb2c(config: ConfigService): PublicClientApplication;
80
- declare function MSALAngularConfigFactory(): MSPMsalGuardConfiguration;
81
- declare function MSALAngularConfigFactoryb2c(config: ConfigService): MSPMsalGuardConfiguration;
82
- declare function withMicrosoftSupport(type?: string): AuthFeature<AuthFeatureKind.Microsoft>;
78
+ declare function MSALAngularConfigFactory(config: ConfigService): MsalGuardConfigurationWithType;
79
+ declare function MSALAngularConfigFactoryb2c(config: ConfigService): MsalGuardConfigurationWithType;
80
+ declare function withMicrosoftSupport(type?: string, serviceFactory?: IMsalServiceFactory): AuthFeature<AuthFeatureKind.Microsoft>;
81
+ type IMsalServiceFactory = (config: ConfigService) => AuthService;
82
+
83
+ interface IAuthMsalOptions extends AuthOptions {
84
+ microsoft: AuthMicrosoftOptions;
85
+ }
86
+ declare class AuthMsalService extends AuthService<IAuthMsalOptions> {
87
+ private msalService;
88
+ private msalGuardConfig;
89
+ private _isInitialized$;
90
+ autoLogin: boolean;
91
+ constructor();
92
+ login(): Observable<IUser>;
93
+ logout(): void;
94
+ private getConf;
95
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthMsalService, never>;
96
+ static ɵprov: i0.ɵɵInjectableDeclaration<AuthMsalService>;
97
+ }
83
98
 
84
- export { AUTH_MICROSOFT_DIRECTIVES, AuthMicrosoftComponent, AuthMicrosoftb2cComponent, MSALAngularConfigFactory, MSALAngularConfigFactoryb2c, MSALConfigFactory, MSALConfigFactoryb2c, withMicrosoftSupport };
85
- export type { AuthMicrosoftOptions, AuthMicrosoftb2cOptions, AuthMicrosoftb2cOptionsAuthorities, AuthMicrosoftb2cOptionsAuthority, AuthMicrosoftb2cOptionsNames, AuthMicrosoftb2cOptionsOptions, MSPMsalGuardConfiguration };
99
+ export { AUTH_MICROSOFT_DIRECTIVES, AuthMicrosoftComponent, AuthMicrosoftb2cComponent, AuthMsalService, MSALAngularConfigFactory, MSALAngularConfigFactoryb2c, MSALConfigFactory, MSALConfigFactoryb2c, withMicrosoftSupport };
100
+ export type { AuthMicrosoftOptions, AuthMicrosoftb2cOptions, AuthMicrosoftb2cOptionsAuthorities, AuthMicrosoftb2cOptionsAuthority, AuthMicrosoftb2cOptionsNames, AuthMicrosoftb2cOptionsOptions, IMsalServiceFactory, MsalGuardConfigurationWithType };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igo2/auth",
3
- "version": "20.1.0-next.2",
3
+ "version": "20.1.0-next.21",
4
4
  "description": "IGO Library",
5
5
  "author": "IGO Community",
6
6
  "keywords": [
@@ -10,7 +10,8 @@
10
10
  "homepage": "https://github.com/infra-geo-ouverte/igo2-lib#readme",
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "git+https://github.com/infra-geo-ouverte/igo2-lib.git"
13
+ "url": "git+https://github.com/infra-geo-ouverte/igo2-lib.git",
14
+ "directory": "packages/auth"
14
15
  },
15
16
  "bugs": {
16
17
  "url": "https://github.com/infra-geo-ouverte/igo2-lib/issues"
@@ -64,9 +65,9 @@
64
65
  "@angular/router": "^20.0.0",
65
66
  "@azure/msal-angular": "^4.0.0",
66
67
  "@azure/msal-browser": "^4.0.0",
67
- "@igo2/common": "^20.1.0-next.2",
68
- "@igo2/core": "^20.1.0-next.2",
69
- "@igo2/utils": "^20.1.0-next.2",
68
+ "@igo2/common": "^20.1.0-next.21",
69
+ "@igo2/core": "^20.1.0-next.21",
70
+ "@igo2/utils": "^20.1.0-next.21",
70
71
  "jwt-decode": "^4.0.0",
71
72
  "rxjs": "^7.8.0",
72
73
  "ts-cacheable": "^1.0.6",