@igo2/auth 16.0.0-rc.0 → 16.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/esm2022/lib/auth-form/auth-facebook.component.mjs +3 -3
  2. package/esm2022/lib/auth-form/auth-form.component.mjs +5 -5
  3. package/esm2022/lib/auth-form/auth-google.component.mjs +3 -3
  4. package/esm2022/lib/auth-form/auth-intern.component.mjs +5 -5
  5. package/esm2022/lib/auth-form/auth-microsoft.component.mjs +7 -7
  6. package/esm2022/lib/auth-form/auth-microsoftb2c.component.mjs +7 -7
  7. package/esm2022/lib/auth-routing.module.mjs +1 -1
  8. package/esm2022/lib/auth.module.mjs +10 -10
  9. package/esm2022/lib/environment/environment.interface.mjs +2 -0
  10. package/esm2022/lib/environment/index.mjs +2 -0
  11. package/esm2022/lib/shared/admin.guard.mjs +2 -2
  12. package/esm2022/lib/shared/auth-microsoft.provider.mjs +3 -3
  13. package/esm2022/lib/shared/auth-msalBroadcastServiceb2c.service.mjs +2 -2
  14. package/esm2022/lib/shared/auth-msalServiceb2c.service..mjs +3 -3
  15. package/esm2022/lib/shared/auth.guard.mjs +2 -2
  16. package/esm2022/lib/shared/auth.interceptor.mjs +9 -8
  17. package/esm2022/lib/shared/auth.interface.mjs +1 -1
  18. package/esm2022/lib/shared/auth.service.mjs +17 -18
  19. package/esm2022/lib/shared/index.mjs +13 -0
  20. package/esm2022/lib/shared/logged.guard.mjs +2 -2
  21. package/esm2022/lib/shared/profils.guard.mjs +3 -3
  22. package/esm2022/lib/shared/protected.directive.mjs +1 -1
  23. package/esm2022/lib/shared/storage.service.mjs +3 -3
  24. package/esm2022/lib/shared/token.service.mjs +2 -2
  25. package/esm2022/public_api.mjs +2 -1
  26. package/fesm2022/igo2-auth.mjs +30 -30
  27. package/fesm2022/igo2-auth.mjs.map +1 -1
  28. package/lib/auth-form/auth-form.component.d.ts +1 -1
  29. package/lib/auth-form/auth-intern.component.d.ts +2 -2
  30. package/lib/auth-form/auth-microsoft.component.d.ts +1 -1
  31. package/lib/auth-form/auth-microsoftb2c.component.d.ts +1 -1
  32. package/lib/environment/environment.interface.d.ts +5 -0
  33. package/lib/environment/index.d.ts +1 -0
  34. package/lib/shared/admin.guard.d.ts +1 -1
  35. package/lib/shared/auth-microsoft.provider.d.ts +2 -2
  36. package/lib/shared/auth-msalBroadcastServiceb2c.service.d.ts +1 -1
  37. package/lib/shared/auth-msalServiceb2c.service..d.ts +2 -2
  38. package/lib/shared/auth.guard.d.ts +1 -1
  39. package/lib/shared/auth.interceptor.d.ts +3 -2
  40. package/lib/shared/auth.interface.d.ts +3 -6
  41. package/lib/shared/auth.service.d.ts +3 -2
  42. package/lib/shared/index.d.ts +12 -0
  43. package/lib/shared/logged.guard.d.ts +1 -1
  44. package/lib/shared/profils.guard.d.ts +1 -1
  45. package/lib/shared/storage.service.d.ts +2 -2
  46. package/locale/en.auth.json +28 -28
  47. package/package.json +3 -3
  48. package/public_api.d.ts +1 -0
@@ -1,6 +1,6 @@
1
1
  import { ApplicationRef, EventEmitter } from '@angular/core';
2
- import { MsalService } from '@azure/msal-angular';
3
2
  import { ConfigService } from '@igo2/core';
3
+ import { MsalService } from '@azure/msal-angular';
4
4
  import { MSPMsalGuardConfiguration } from '../shared/auth.interface';
5
5
  import { AuthService } from '../shared/auth.service';
6
6
  import * as i0 from "@angular/core";
@@ -1,8 +1,8 @@
1
1
  import { ApplicationRef, EventEmitter } from '@angular/core';
2
2
  import { ConfigService } from '@igo2/core';
3
+ import { MsalServiceb2c } from '../shared/auth-msalServiceb2c.service.';
3
4
  import { MSPMsalGuardConfiguration } from '../shared/auth.interface';
4
5
  import { AuthService } from '../shared/auth.service';
5
- import { MsalServiceb2c } from '../shared/auth-msalServiceb2c.service.';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class AuthMicrosoftb2cComponent {
8
8
  private authService;
@@ -0,0 +1,5 @@
1
+ import { AuthOptions, AuthStorageOptions } from '../shared';
2
+ export interface EnvironmentOptions {
3
+ auth?: AuthOptions;
4
+ storage?: AuthStorageOptions;
5
+ }
@@ -0,0 +1 @@
1
+ export * from './environment.interface';
@@ -1,4 +1,4 @@
1
- import { Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
1
+ import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
2
2
  import { ConfigService } from '@igo2/core';
3
3
  import { AuthService } from './auth.service';
4
4
  import * as i0 from "@angular/core";
@@ -1,8 +1,8 @@
1
+ import { ConfigService } from '@igo2/core';
1
2
  import { MsalService } from '@azure/msal-angular';
2
3
  import { PublicClientApplication } from '@azure/msal-browser';
3
- import { ConfigService } from '@igo2/core';
4
- import { MSPMsalGuardConfiguration } from './auth.interface';
5
4
  import { MsalServiceb2c } from './auth-msalServiceb2c.service.';
5
+ import { MSPMsalGuardConfiguration } from './auth.interface';
6
6
  export declare function MSALConfigFactory(config: ConfigService): PublicClientApplication;
7
7
  export declare function MSALConfigFactoryb2c(config: ConfigService): PublicClientApplication;
8
8
  export declare function MSALAngularConfigFactory(config: ConfigService): MSPMsalGuardConfiguration;
@@ -1,5 +1,5 @@
1
- import { Observable } from 'rxjs';
2
1
  import { EventMessage, IPublicClientApplication, InteractionStatus } from '@azure/msal-browser';
2
+ import { Observable } from 'rxjs';
3
3
  import { MsalServiceb2c } from './auth-msalServiceb2c.service.';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class MsalBroadcastServiceb2c {
@@ -1,7 +1,7 @@
1
1
  import { Location } from '@angular/common';
2
- import { IPublicClientApplication, EndSessionRequest, EndSessionPopupRequest, AuthenticationResult, RedirectRequest, SilentRequest, PopupRequest, SsoSilentRequest, Logger } from '@azure/msal-browser';
3
- import { Observable } from 'rxjs';
4
2
  import { IMsalService } from '@azure/msal-angular';
3
+ import { AuthenticationResult, EndSessionPopupRequest, EndSessionRequest, IPublicClientApplication, Logger, PopupRequest, RedirectRequest, SilentRequest, SsoSilentRequest } from '@azure/msal-browser';
4
+ import { Observable } from 'rxjs';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class MsalServiceb2c implements IMsalService {
7
7
  instance: IPublicClientApplication;
@@ -1,4 +1,4 @@
1
- import { Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
1
+ import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
2
2
  import { ConfigService } from '@igo2/core';
3
3
  import { AuthService } from './auth.service';
4
4
  import * as i0 from "@angular/core";
@@ -1,13 +1,14 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
- import { HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http';
3
- import { Observable } from 'rxjs';
2
+ import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
4
3
  import { ConfigService } from '@igo2/core';
4
+ import { Observable } from 'rxjs';
5
5
  import { TokenService } from './token.service';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class AuthInterceptor implements HttpInterceptor {
8
8
  private config;
9
9
  private tokenService;
10
10
  private http;
11
+ private authOptions;
11
12
  private refreshInProgress;
12
13
  private trustHosts;
13
14
  private hostsWithCredentials;
@@ -1,5 +1,5 @@
1
- import { BrowserAuthOptions } from '@azure/msal-browser';
2
1
  import { MsalGuardConfiguration } from '@azure/msal-angular';
2
+ import { BrowserAuthOptions } from '@azure/msal-browser';
3
3
  export interface AuthInternOptions {
4
4
  enabled?: boolean;
5
5
  }
@@ -12,11 +12,8 @@ export interface AuthGoogleOptions {
12
12
  apiKey: string;
13
13
  clientId: string;
14
14
  }
15
- export interface AuthMicrosoftOptions {
15
+ export interface AuthMicrosoftOptions extends BrowserAuthOptions {
16
16
  enabled?: boolean;
17
- clientId: string;
18
- redirectUri?: string;
19
- authority?: string;
20
17
  }
21
18
  export interface AuthMicrosoftb2cOptions {
22
19
  enabled?: boolean;
@@ -44,7 +41,7 @@ export interface AuthMicrosoftb2cOptionsAuthority {
44
41
  }
45
42
  export interface AuthOptions {
46
43
  url?: string;
47
- tokenKey: string;
44
+ tokenKey?: string;
48
45
  allowAnonymous?: boolean;
49
46
  loginRoute?: string;
50
47
  logoutRoute?: string;
@@ -1,8 +1,8 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
2
  import { Router } from '@angular/router';
3
- import { Observable, BehaviorSubject } from 'rxjs';
4
3
  import { ConfigService, LanguageService, MessageService } from '@igo2/core';
5
- import { User, IInfosUser } from './auth.interface';
4
+ import { BehaviorSubject, Observable } from 'rxjs';
5
+ import { IInfosUser, User } from './auth.interface';
6
6
  import { TokenService } from './token.service';
7
7
  import * as i0 from "@angular/core";
8
8
  export declare class AuthService {
@@ -17,6 +17,7 @@ export declare class AuthService {
17
17
  redirectUrl: string;
18
18
  languageForce: boolean;
19
19
  private anonymous;
20
+ private authOptions;
20
21
  get hasAuthService(): boolean;
21
22
  constructor(http: HttpClient, tokenService: TokenService, config: ConfigService, languageService: LanguageService, messageService: MessageService, router: Router);
22
23
  login(username: string, password: string): Observable<void>;
@@ -0,0 +1,12 @@
1
+ export * from './token.service';
2
+ export * from './auth.service';
3
+ export * from './auth.interface';
4
+ export * from './auth.interceptor';
5
+ export * from './auth-microsoft.provider';
6
+ export * from './logged.guard';
7
+ export * from './auth.guard';
8
+ export * from './admin.guard';
9
+ export * from './profils.guard';
10
+ export * from './protected.directive';
11
+ export * from './storage.interface';
12
+ export * from './storage.service';
@@ -1,4 +1,4 @@
1
- import { Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
1
+ import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
2
2
  import { ConfigService } from '@igo2/core';
3
3
  import { AuthService } from './auth.service';
4
4
  import * as i0 from "@angular/core";
@@ -1,4 +1,4 @@
1
- import { Router, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
1
+ import { ActivatedRouteSnapshot, Router, RouterStateSnapshot } from '@angular/router';
2
2
  import { ConfigService } from '@igo2/core';
3
3
  import { AuthService } from './auth.service';
4
4
  import * as i0 from "@angular/core";
@@ -1,8 +1,8 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
- import { StorageScope, ConfigService, BaseStorage } from '@igo2/core';
2
+ import { BaseStorage, ConfigService, StorageScope } from '@igo2/core';
3
3
  import { AuthService } from './auth.service';
4
- import { TokenService } from './token.service';
5
4
  import { AuthStorageOptions } from './storage.interface';
5
+ import { TokenService } from './token.service';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class AuthStorageService extends BaseStorage<AuthStorageOptions> {
8
8
  private http;
@@ -1,28 +1,28 @@
1
- {
2
- "igo": {
3
- "auth": {
4
- "accessAnonymous": "Access as anonymous",
5
- "connection": "Connection",
6
- "login": "Login",
7
- "password": "Password",
8
- "signOut": "Sign out",
9
- "user": "User",
10
- "welcome": "Welcome {{name}}!",
11
- "deconnection": "You are logged out.",
12
- "home": "Return to the home page",
13
- "error": {
14
- "Password expired": "Password expired",
15
- "Maximun logins exceeded": "Maximum logins exceeded",
16
- "Login lockout": "Maximum number of attempts exceeded. Your account is locked.",
17
- "Wrong password": "Wrong password",
18
- "Invalid username": "Invalid username"
19
- },
20
- "microsoft": {
21
- "login": "Sign in with Azure account"
22
- },
23
- "microsoftb2c": {
24
- "login": "Sign in"
25
- }
26
- }
27
- }
28
- }
1
+ {
2
+ "igo": {
3
+ "auth": {
4
+ "accessAnonymous": "Access as anonymous",
5
+ "connection": "Connection",
6
+ "login": "Login",
7
+ "password": "Password",
8
+ "signOut": "Sign out",
9
+ "user": "User",
10
+ "welcome": "Welcome {{name}}!",
11
+ "deconnection": "You are logged out.",
12
+ "home": "Return to the home page",
13
+ "error": {
14
+ "Password expired": "Password expired",
15
+ "Maximun logins exceeded": "Maximum logins exceeded",
16
+ "Login lockout": "Maximum number of attempts exceeded. Your account is locked.",
17
+ "Wrong password": "Wrong password",
18
+ "Invalid username": "Invalid username"
19
+ },
20
+ "microsoft": {
21
+ "login": "Sign in with Azure account"
22
+ },
23
+ "microsoftb2c": {
24
+ "login": "Sign in"
25
+ }
26
+ }
27
+ }
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igo2/auth",
3
- "version": "16.0.0-rc.0",
3
+ "version": "16.0.0-rc.2",
4
4
  "description": "IGO Library",
5
5
  "author": "IGO Community",
6
6
  "keywords": [
@@ -28,8 +28,8 @@
28
28
  "@angular/forms": "^16.2.5",
29
29
  "@angular/material": "^16.2.4",
30
30
  "@angular/router": "^16.2.5",
31
- "@igo2/core": "^16.0.0-rc.0",
32
- "@igo2/utils": "^16.0.0-rc.0",
31
+ "@igo2/core": "^16.0.0-rc.2",
32
+ "@igo2/utils": "^16.0.0-rc.2",
33
33
  "rxjs": "^7.5.6",
34
34
  "@azure/msal-angular": "^3.0.4"
35
35
  },
package/public_api.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { AuthFormComponent } from './lib/auth-form';
2
+ export * from './lib/environment';
2
3
  export * from './lib/shared/auth.service';
3
4
  export * from './lib/shared/logged.guard';
4
5
  export * from './lib/shared/auth.guard';