@abp/ng.oauth 9.3.6 → 10.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.
package/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ModuleWithProviders, Injector, Provider } from '@angular/core';
3
3
  import * as angular_oauth2_oidc from 'angular-oauth2-oidc';
4
4
  import { OAuthStorage, OAuthErrorEvent, OAuthService, AuthConfig } from 'angular-oauth2-oidc';
5
5
  import * as _abp_ng_core from '@abp/ng.core';
6
- import { PipeToLoginFn, CheckAuthenticationStateFn, IAuthService, LoginParams, AbpAuthResponse, AbstractAuthErrorFilter, AuthErrorFilter, AbpLocalStorageService, HttpErrorReporterService, EnvironmentService, ConfigStateService, SessionStateService, AbpWindowService, ABP, IApiInterceptor, HttpWaitService, IAbpGuard, AuthService } from '@abp/ng.core';
6
+ import { PipeToLoginFn, CheckAuthenticationStateFn, IAuthService, LoginParams, AbpAuthResponse, AbstractAuthErrorFilter, AuthErrorFilter, AbpLocalStorageService, AbpCookieStorageService, HttpErrorReporterService, EnvironmentService, ConfigStateService, SessionStateService, AbpWindowService, IApiInterceptor, IAbpGuard, AuthService } from '@abp/ng.core';
7
7
  import * as rxjs from 'rxjs';
8
8
  import { Observable } from 'rxjs';
9
9
  import { Params, Router, ActivatedRouteSnapshot, RouterStateSnapshot, UrlTree, CanActivateFn } from '@angular/router';
@@ -19,25 +19,35 @@ declare class AbpOAuthModule {
19
19
  static ɵinj: i0.ɵɵInjectorDeclaration<AbpOAuthModule>;
20
20
  }
21
21
 
22
- declare const oAuthStorage: Storage;
23
-
24
- declare function storageFactory(): OAuthStorage;
22
+ declare class MockStorage implements Storage {
23
+ private data;
24
+ get length(): number;
25
+ clear(): void;
26
+ getItem(key: string): string;
27
+ key(index: number): string;
28
+ removeItem(key: string): void;
29
+ setItem(key: string, value: string): void;
30
+ }
31
+ declare function oAuthStorageFactory(): OAuthStorage;
25
32
 
26
33
  declare const pipeToLogin: PipeToLoginFn;
27
34
  declare function isTokenExpired(expireDate: number): boolean;
28
35
 
29
- declare function clearOAuthStorage(storage?: OAuthStorage): void;
36
+ declare function clearOAuthStorage(injector: Injector): void;
30
37
 
31
38
  declare const checkAccessToken: CheckAuthenticationStateFn;
32
39
 
33
40
  declare class AbpOAuthService implements IAuthService {
34
41
  protected injector: Injector;
42
+ private appStartedWithSsr;
43
+ private platformId;
44
+ private document;
35
45
  private strategy;
36
46
  private readonly oAuthService;
37
47
  get oidc(): boolean;
38
48
  set oidc(value: boolean);
39
49
  get isInternalAuth(): boolean;
40
- constructor(injector: Injector);
50
+ constructor();
41
51
  init(): Promise<any>;
42
52
  logout(queryParams?: Params): Observable<any>;
43
53
  navigateToLogin(queryParams?: Params): void;
@@ -46,7 +56,7 @@ declare class AbpOAuthService implements IAuthService {
46
56
  loginUsingGrant(grantType: string, parameters: object, headers?: HttpHeaders): Promise<AbpAuthResponse>;
47
57
  getRefreshToken(): string;
48
58
  getAccessToken(): string;
49
- refreshToken(): Promise<AbpAuthResponse>;
59
+ refreshToken(): Promise<AbpAuthResponse | void>;
50
60
  getAccessTokenExpiration(): number;
51
61
  static ɵfac: i0.ɵɵFactoryDeclaration<AbpOAuthService, never>;
52
62
  static ɵprov: i0.ɵɵInjectableDeclaration<AbpOAuthService>;
@@ -67,6 +77,8 @@ declare class OAuthErrorFilterService extends AbstractAuthErrorFilter<AuthErrorF
67
77
  declare class RememberMeService {
68
78
  #private;
69
79
  protected readonly localStorageService: AbpLocalStorageService;
80
+ protected readonly cookieStorageService: AbpCookieStorageService;
81
+ private appStartedWithSsr;
70
82
  set(remember: boolean): void;
71
83
  remove(): void;
72
84
  get(): boolean;
@@ -75,6 +87,28 @@ declare class RememberMeService {
75
87
  static ɵprov: i0.ɵɵInjectableDeclaration<RememberMeService>;
76
88
  }
77
89
 
90
+ declare class BrowserTokenStorageService implements OAuthStorage {
91
+ getItem(key: string): string;
92
+ removeItem(key: string): void;
93
+ setItem(key: string, data: string): void;
94
+ readCookie(name: string): string | null;
95
+ writeCookie(name: string, value: string, days?: number): void;
96
+ removeCookie(name: string): void;
97
+ static ɵfac: i0.ɵɵFactoryDeclaration<BrowserTokenStorageService, never>;
98
+ static ɵprov: i0.ɵɵInjectableDeclaration<BrowserTokenStorageService>;
99
+ }
100
+
101
+ declare class ServerTokenStorageService implements OAuthStorage {
102
+ private req;
103
+ private cookies;
104
+ constructor(req: Request | null);
105
+ getItem(key: string): string;
106
+ setItem(_k: string, _v: string): void;
107
+ removeItem(_k: string): void;
108
+ static ɵfac: i0.ɵɵFactoryDeclaration<ServerTokenStorageService, [{ optional: true; }]>;
109
+ static ɵprov: i0.ɵɵInjectableDeclaration<ServerTokenStorageService>;
110
+ }
111
+
78
112
  declare abstract class AuthFlowStrategy {
79
113
  protected injector: Injector;
80
114
  abstract readonly isInternalAuth: boolean;
@@ -103,7 +137,12 @@ declare abstract class AuthFlowStrategy {
103
137
  }
104
138
 
105
139
  declare class AuthCodeFlowStrategy extends AuthFlowStrategy {
140
+ protected injector: Injector;
106
141
  readonly isInternalAuth = false;
142
+ private platformId;
143
+ protected appStartedWithSSR: boolean;
144
+ protected document: Document;
145
+ constructor(injector: Injector);
107
146
  init(): Promise<void>;
108
147
  private checkRememberMeOption;
109
148
  private getCultureParams;
@@ -305,7 +344,7 @@ declare class OAuthConfigurationHandler {
305
344
  private oAuthService;
306
345
  private environmentService;
307
346
  private options;
308
- constructor(oAuthService: OAuthService, environmentService: EnvironmentService, options: ABP.Root);
347
+ constructor();
309
348
  private listenToSetEnvironment;
310
349
  static ɵfac: i0.ɵɵFactoryDeclaration<OAuthConfigurationHandler, never>;
311
350
  static ɵprov: i0.ɵɵInjectableDeclaration<OAuthConfigurationHandler>;
@@ -316,7 +355,6 @@ declare class OAuthApiInterceptor implements IApiInterceptor {
316
355
  private sessionState;
317
356
  private httpWaitService;
318
357
  private tenantKey;
319
- constructor(oAuthService: OAuthService, sessionState: SessionStateService, httpWaitService: HttpWaitService, tenantKey: string);
320
358
  intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
321
359
  getAdditionalHeaders(existingHeaders?: HttpHeaders): any;
322
360
  static ɵfac: i0.ɵɵFactoryDeclaration<OAuthApiInterceptor, never>;
@@ -334,9 +372,11 @@ declare class AbpOAuthGuard implements IAbpGuard {
334
372
  static ɵprov: i0.ɵɵInjectableDeclaration<AbpOAuthGuard>;
335
373
  }
336
374
  declare const abpOAuthGuard: CanActivateFn;
375
+ declare const buildLoginUrl: (path: string, params?: Params) => string;
376
+ declare const asyncAbpOAuthGuard: CanActivateFn;
337
377
 
338
378
  declare const NavigateToManageProfileProvider: Provider;
339
379
 
340
380
  declare function provideAbpOAuth(): i0.EnvironmentProviders;
341
381
 
342
- export { AUTH_FLOW_STRATEGY, AbpOAuthGuard, AbpOAuthModule, AbpOAuthService, AuthCodeFlowStrategy, AuthFlowStrategy, AuthPasswordFlowStrategy, NavigateToManageProfileProvider, OAuthApiInterceptor, OAuthConfigurationHandler, OAuthErrorFilterService, RememberMeService, abpOAuthGuard, checkAccessToken, clearOAuthStorage, isTokenExpired, oAuthStorage, pipeToLogin, provideAbpOAuth, storageFactory };
382
+ export { AUTH_FLOW_STRATEGY, AbpOAuthGuard, AbpOAuthModule, AbpOAuthService, AuthCodeFlowStrategy, AuthFlowStrategy, AuthPasswordFlowStrategy, BrowserTokenStorageService, MockStorage, NavigateToManageProfileProvider, OAuthApiInterceptor, OAuthConfigurationHandler, OAuthErrorFilterService, RememberMeService, ServerTokenStorageService, abpOAuthGuard, asyncAbpOAuthGuard, buildLoginUrl, checkAccessToken, clearOAuthStorage, isTokenExpired, oAuthStorageFactory, pipeToLogin, provideAbpOAuth };
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@abp/ng.oauth",
3
- "version": "9.3.6",
3
+ "version": "10.0.0-rc.2",
4
4
  "homepage": "https://abp.io",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/abpframework/abp.git"
8
8
  },
9
9
  "dependencies": {
10
- "@abp/ng.core": "~9.3.6",
11
- "@abp/utils": "~9.3.6",
10
+ "@abp/ng.core": "~10.0.0-rc.2",
11
+ "@abp/utils": "~10.0.0-rc.2",
12
12
  "angular-oauth2-oidc": "^20.0.0",
13
13
  "just-clone": "^6.0.0",
14
14
  "just-compare": "^2.0.0",