@abp/ng.oauth 7.0.0-rc.6

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 (56) hide show
  1. package/README.md +7 -0
  2. package/esm2020/abp-ng.oauth.mjs +5 -0
  3. package/esm2020/lib/guards/index.mjs +2 -0
  4. package/esm2020/lib/guards/oauth.guard.mjs +29 -0
  5. package/esm2020/lib/handlers/index.mjs +2 -0
  6. package/esm2020/lib/handlers/oauth-configuration.handler.mjs +36 -0
  7. package/esm2020/lib/interceptors/api.interceptor.mjs +52 -0
  8. package/esm2020/lib/interceptors/index.mjs +2 -0
  9. package/esm2020/lib/oauth.module.mjs +70 -0
  10. package/esm2020/lib/providers/index.mjs +2 -0
  11. package/esm2020/lib/providers/navigate-to-manage-profile.provider.mjs +17 -0
  12. package/esm2020/lib/services/index.mjs +2 -0
  13. package/esm2020/lib/services/oauth.service.mjs +48 -0
  14. package/esm2020/lib/strategies/auth-code-flow-strategy.mjs +35 -0
  15. package/esm2020/lib/strategies/auth-flow-strategy.mjs +61 -0
  16. package/esm2020/lib/strategies/auth-password-flow-strategy.mjs +67 -0
  17. package/esm2020/lib/strategies/index.mjs +4 -0
  18. package/esm2020/lib/tokens/auth-flow-strategy.mjs +11 -0
  19. package/esm2020/lib/tokens/index.mjs +2 -0
  20. package/esm2020/lib/utils/auth-utils.mjs +42 -0
  21. package/esm2020/lib/utils/check-access-token.mjs +11 -0
  22. package/esm2020/lib/utils/clear-o-auth-storage.mjs +19 -0
  23. package/esm2020/lib/utils/index.mjs +6 -0
  24. package/esm2020/lib/utils/oauth-storage.mjs +2 -0
  25. package/esm2020/lib/utils/storage.factory.mjs +5 -0
  26. package/esm2020/public-api.mjs +10 -0
  27. package/fesm2015/abp-ng.oauth.mjs +469 -0
  28. package/fesm2015/abp-ng.oauth.mjs.map +1 -0
  29. package/fesm2020/abp-ng.oauth.mjs +451 -0
  30. package/fesm2020/abp-ng.oauth.mjs.map +1 -0
  31. package/index.d.ts +5 -0
  32. package/lib/guards/index.d.ts +1 -0
  33. package/lib/guards/oauth.guard.d.ts +13 -0
  34. package/lib/handlers/index.d.ts +1 -0
  35. package/lib/handlers/oauth-configuration.handler.d.ts +12 -0
  36. package/lib/interceptors/api.interceptor.d.ts +15 -0
  37. package/lib/interceptors/index.d.ts +1 -0
  38. package/lib/oauth.module.d.ts +10 -0
  39. package/lib/providers/index.d.ts +1 -0
  40. package/lib/providers/navigate-to-manage-profile.provider.d.ts +2 -0
  41. package/lib/services/index.d.ts +1 -0
  42. package/lib/services/oauth.service.d.ts +20 -0
  43. package/lib/strategies/auth-code-flow-strategy.d.ts +11 -0
  44. package/lib/strategies/auth-flow-strategy.d.ts +25 -0
  45. package/lib/strategies/auth-password-flow-strategy.d.ts +184 -0
  46. package/lib/strategies/index.d.ts +3 -0
  47. package/lib/tokens/auth-flow-strategy.d.ts +7 -0
  48. package/lib/tokens/index.d.ts +1 -0
  49. package/lib/utils/auth-utils.d.ts +6 -0
  50. package/lib/utils/check-access-token.d.ts +2 -0
  51. package/lib/utils/clear-o-auth-storage.d.ts +2 -0
  52. package/lib/utils/index.d.ts +5 -0
  53. package/lib/utils/oauth-storage.d.ts +1 -0
  54. package/lib/utils/storage.factory.d.ts +2 -0
  55. package/package.json +40 -0
  56. package/public-api.d.ts +9 -0
@@ -0,0 +1,25 @@
1
+ import { Injector } from '@angular/core';
2
+ import { Params } from '@angular/router';
3
+ import { AuthConfig, OAuthService as OAuthService2 } from 'angular-oauth2-oidc';
4
+ import { Observable } from 'rxjs';
5
+ import { LoginParams, ConfigStateService, EnvironmentService, HttpErrorReporterService, SessionStateService } from '@abp/ng.core';
6
+ export declare abstract class AuthFlowStrategy {
7
+ protected injector: Injector;
8
+ abstract readonly isInternalAuth: boolean;
9
+ protected httpErrorReporter: HttpErrorReporterService;
10
+ protected environment: EnvironmentService;
11
+ protected configState: ConfigStateService;
12
+ protected oAuthService: OAuthService2;
13
+ protected oAuthConfig: AuthConfig;
14
+ protected sessionState: SessionStateService;
15
+ protected tenantKey: string;
16
+ abstract checkIfInternalAuth(queryParams?: Params): boolean;
17
+ abstract navigateToLogin(queryParams?: Params): void;
18
+ abstract logout(queryParams?: Params): Observable<any>;
19
+ abstract login(params?: LoginParams | Params): Observable<any>;
20
+ private catchError;
21
+ constructor(injector: Injector);
22
+ init(): Promise<any>;
23
+ protected refreshToken(): Promise<void | import("angular-oauth2-oidc").TokenResponse>;
24
+ protected listenToOauthErrors(): void;
25
+ }
@@ -0,0 +1,184 @@
1
+ import { Params } from '@angular/router';
2
+ import { Observable } from 'rxjs';
3
+ import { AuthFlowStrategy } from './auth-flow-strategy';
4
+ import { LoginParams } from '@abp/ng.core';
5
+ export declare class AuthPasswordFlowStrategy extends AuthFlowStrategy {
6
+ readonly isInternalAuth = true;
7
+ private cookieKey;
8
+ private storageKey;
9
+ private listenToTokenExpiration;
10
+ init(): Promise<void>;
11
+ navigateToLogin(queryParams?: Params): Promise<boolean>;
12
+ checkIfInternalAuth(): boolean;
13
+ login(params: LoginParams): Observable<any>;
14
+ logout(queryParams?: Params): Observable<{
15
+ localization?: {
16
+ values?: {
17
+ [x: string]: {
18
+ [x: string]: string;
19
+ };
20
+ };
21
+ resources?: {
22
+ [x: string]: {
23
+ texts?: {
24
+ [x: string]: string;
25
+ };
26
+ baseResources?: string[];
27
+ };
28
+ };
29
+ languages?: import("@abp/ng.core").LanguageInfo[];
30
+ currentCulture?: {
31
+ displayName?: string;
32
+ englishName?: string;
33
+ threeLetterIsoLanguageName?: string;
34
+ twoLetterIsoLanguageName?: string;
35
+ isRightToLeft?: boolean;
36
+ cultureName?: string;
37
+ name?: string;
38
+ nativeName?: string;
39
+ dateTimeFormat?: {
40
+ calendarAlgorithmType?: string;
41
+ dateTimeFormatLong?: string;
42
+ shortDatePattern?: string;
43
+ fullDateTimePattern?: string;
44
+ dateSeparator?: string;
45
+ shortTimePattern?: string;
46
+ longTimePattern?: string;
47
+ };
48
+ };
49
+ defaultResourceName?: string;
50
+ languagesMap?: {
51
+ [x: string]: import("@abp/ng.core").NameValue<string>[];
52
+ };
53
+ languageFilesMap?: {
54
+ [x: string]: import("@abp/ng.core").NameValue<string>[];
55
+ };
56
+ };
57
+ auth?: {
58
+ grantedPolicies?: {
59
+ [x: string]: boolean;
60
+ };
61
+ };
62
+ setting?: {
63
+ values?: {
64
+ [x: string]: string;
65
+ };
66
+ };
67
+ currentUser?: {
68
+ isAuthenticated?: boolean;
69
+ id?: string;
70
+ tenantId?: string;
71
+ impersonatorUserId?: string;
72
+ impersonatorTenantId?: string;
73
+ impersonatorUserName?: string;
74
+ impersonatorTenantName?: string;
75
+ userName?: string;
76
+ name?: string;
77
+ surName?: string;
78
+ email?: string;
79
+ emailVerified?: boolean;
80
+ phoneNumber?: string;
81
+ phoneNumberVerified?: boolean;
82
+ roles?: string[];
83
+ };
84
+ features?: {
85
+ values?: {
86
+ [x: string]: string;
87
+ };
88
+ };
89
+ globalFeatures?: {
90
+ enabledFeatures?: string[];
91
+ };
92
+ multiTenancy?: {
93
+ isEnabled?: boolean;
94
+ };
95
+ currentTenant?: {
96
+ id?: string;
97
+ name?: string;
98
+ isAvailable?: boolean;
99
+ };
100
+ timing?: {
101
+ timeZone?: {
102
+ iana?: {
103
+ timeZoneName?: string;
104
+ };
105
+ windows?: {
106
+ timeZoneId?: string;
107
+ };
108
+ };
109
+ };
110
+ clock?: {
111
+ kind?: string;
112
+ };
113
+ objectExtensions?: {
114
+ modules?: {
115
+ [x: string]: {
116
+ entities?: {
117
+ [x: string]: {
118
+ properties?: {
119
+ [x: string]: {
120
+ type?: string;
121
+ typeSimple?: string;
122
+ displayName?: {
123
+ name?: string;
124
+ resource?: string;
125
+ };
126
+ api?: {
127
+ onGet?: {
128
+ isAvailable?: boolean;
129
+ };
130
+ onCreate?: {
131
+ isAvailable?: boolean;
132
+ };
133
+ onUpdate?: {
134
+ isAvailable?: boolean;
135
+ };
136
+ };
137
+ ui?: {
138
+ onTable?: {
139
+ isVisible?: boolean;
140
+ };
141
+ onCreateForm?: {
142
+ isVisible?: boolean;
143
+ };
144
+ onEditForm?: {
145
+ isVisible?: boolean;
146
+ };
147
+ lookup?: {
148
+ url?: string;
149
+ resultListPropertyName?: string;
150
+ displayPropertyName?: string;
151
+ valuePropertyName?: string;
152
+ filterParamName?: string;
153
+ };
154
+ };
155
+ attributes?: import("@abp/ng.core").ExtensionPropertyAttributeDto[];
156
+ configuration?: {
157
+ [x: string]: object;
158
+ };
159
+ defaultValue?: object;
160
+ };
161
+ };
162
+ configuration?: {
163
+ [x: string]: object;
164
+ };
165
+ };
166
+ };
167
+ configuration?: {
168
+ [x: string]: object;
169
+ };
170
+ };
171
+ };
172
+ enums?: {
173
+ [x: string]: {
174
+ fields?: import("@abp/ng.core").ExtensionEnumFieldDto[];
175
+ localizationResource?: string;
176
+ };
177
+ };
178
+ };
179
+ extraProperties?: {
180
+ [x: string]: object;
181
+ };
182
+ }>;
183
+ protected refreshToken(): Promise<void | import("angular-oauth2-oidc").TokenResponse>;
184
+ }
@@ -0,0 +1,3 @@
1
+ export * from './auth-flow-strategy';
2
+ export * from './auth-code-flow-strategy';
3
+ export * from './auth-password-flow-strategy';
@@ -0,0 +1,7 @@
1
+ import { Injector } from '@angular/core';
2
+ import { AuthCodeFlowStrategy } from '../strategies/auth-code-flow-strategy';
3
+ import { AuthPasswordFlowStrategy } from '../strategies/auth-password-flow-strategy';
4
+ export declare const AUTH_FLOW_STRATEGY: {
5
+ Code(injector: Injector): AuthCodeFlowStrategy;
6
+ Password(injector: Injector): AuthPasswordFlowStrategy;
7
+ };
@@ -0,0 +1 @@
1
+ export * from './auth-flow-strategy';
@@ -0,0 +1,6 @@
1
+ import { TokenResponse } from 'angular-oauth2-oidc';
2
+ import { PipeToLoginFn, SetTokenResponseToStorageFn } from '@abp/ng.core';
3
+ export declare const pipeToLogin: PipeToLoginFn;
4
+ export declare const setTokenResponseToStorage: SetTokenResponseToStorageFn<TokenResponse>;
5
+ export declare function setRememberMe(remember: boolean): void;
6
+ export declare function removeRememberMe(): void;
@@ -0,0 +1,2 @@
1
+ import { CheckAuthenticationStateFn } from '@abp/ng.core';
2
+ export declare const checkAccessToken: CheckAuthenticationStateFn;
@@ -0,0 +1,2 @@
1
+ import { OAuthStorage } from 'angular-oauth2-oidc';
2
+ export declare function clearOAuthStorage(storage?: OAuthStorage): void;
@@ -0,0 +1,5 @@
1
+ export * from './oauth-storage';
2
+ export * from './storage.factory';
3
+ export * from './auth-utils';
4
+ export * from './clear-o-auth-storage';
5
+ export * from './check-access-token';
@@ -0,0 +1 @@
1
+ export declare const oAuthStorage: Storage;
@@ -0,0 +1,2 @@
1
+ import { OAuthStorage } from 'angular-oauth2-oidc';
2
+ export declare function storageFactory(): OAuthStorage;
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@abp/ng.oauth",
3
+ "version": "7.0.0-rc.6",
4
+ "homepage": "https://abp.io",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/abpframework/abp.git"
8
+ },
9
+ "dependencies": {
10
+ "@abp/ng.core": "~7.0.0-rc.6",
11
+ "@abp/utils": "~7.0.0-rc.6",
12
+ "angular-oauth2-oidc": "^15.0.1",
13
+ "just-clone": "^6.1.1",
14
+ "just-compare": "^1.4.0",
15
+ "tslib": "^2.0.0"
16
+ },
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "module": "fesm2015/abp-ng.oauth.mjs",
21
+ "es2020": "fesm2020/abp-ng.oauth.mjs",
22
+ "esm2020": "esm2020/abp-ng.oauth.mjs",
23
+ "fesm2020": "fesm2020/abp-ng.oauth.mjs",
24
+ "fesm2015": "fesm2015/abp-ng.oauth.mjs",
25
+ "typings": "index.d.ts",
26
+ "exports": {
27
+ "./package.json": {
28
+ "default": "./package.json"
29
+ },
30
+ ".": {
31
+ "types": "./index.d.ts",
32
+ "esm2020": "./esm2020/abp-ng.oauth.mjs",
33
+ "es2020": "./fesm2020/abp-ng.oauth.mjs",
34
+ "es2015": "./fesm2015/abp-ng.oauth.mjs",
35
+ "node": "./fesm2015/abp-ng.oauth.mjs",
36
+ "default": "./fesm2020/abp-ng.oauth.mjs"
37
+ }
38
+ },
39
+ "sideEffects": false
40
+ }
@@ -0,0 +1,9 @@
1
+ export * from './lib/oauth.module';
2
+ export * from './lib/utils';
3
+ export * from './lib/tokens';
4
+ export * from './lib/services';
5
+ export * from './lib/strategies';
6
+ export * from './lib/handlers';
7
+ export * from './lib/interceptors';
8
+ export * from './lib/guards';
9
+ export * from './lib/providers';