@acorex/connectivity 20.1.0 → 20.2.0-next.1

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/api/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import * as i0 from '@angular/core';
5
5
  import * as i1 from 'angular-oauth2-oidc';
6
6
  import { AuthConfig } from 'angular-oauth2-oidc';
7
7
  import * as i2 from '@acorex/platform/auth';
8
- import { AXPApplicationLoader, AXPApplication, AXPFeatureLoader, AXPFeature, AXPBaseCredentials, AXPAuthStrategy, AXPSignInResult, AXPSessionContext, AXPRefreshTokenResult, AXPPermissionLoader, AXPPermission, AXPTenantLoader, AXPTenant } from '@acorex/platform/auth';
8
+ import { AXPApplicationLoader, AXPApplication, AXPFeatureLoader, AXPFeature, AXPAuthStrategy, AXPBaseCredentials, AXPSignInResult, AXPSessionContext, AXPRefreshTokenResult, AXPPermissionLoader, AXPPermission, AXPTenantLoader, AXPTenant } from '@acorex/platform/auth';
9
9
  import { Observable } from 'rxjs';
10
10
 
11
11
  declare class AXCApiEntityStorageService implements AXPEntityStorageService<string, any> {
@@ -120,19 +120,33 @@ declare class AXMOidcFeatureLoader implements AXPFeatureLoader {
120
120
  getList(): Observable<AXPFeature[]>;
121
121
  }
122
122
 
123
+ declare class AXMOidcStrategy implements AXPAuthStrategy {
124
+ private aXMAuthConfigs;
125
+ private oauthService;
126
+ private http;
127
+ userInfo: any;
128
+ authConfig: AuthConfig;
129
+ openidConfigurationInfo: any;
130
+ configureOAuth(): Promise<void>;
131
+ signin(credentials: AXPUserPassCredentials): Promise<AXPSignInResult>;
132
+ signout(): Promise<void>;
133
+ refreshToken(context: AXPSessionContext): Promise<AXPRefreshTokenResult>;
134
+ refresh(tenantId?: string, applicationId?: string): Promise<boolean>;
135
+ expires_in_milisecound(expires_in_date: string): number;
136
+ private setServiceProps;
137
+ private loadAuthData;
138
+ loadUserInfo(): Promise<object>;
139
+ calculateExpireInDate(expireInMilisecound: number): string;
140
+ private logout;
141
+ private handleError;
142
+ get name(): string;
143
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXMOidcStrategy, never>;
144
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXMOidcStrategy>;
145
+ }
123
146
  interface AXPUserPassCredentials extends AXPBaseCredentials {
124
147
  username: string;
125
148
  password: string;
126
149
  }
127
- interface AXPOAuthExternalCredentials extends AXPBaseCredentials {
128
- strategy: string;
129
- accessToken: string;
130
- refreshToken: string;
131
- idToken: string;
132
- user: string;
133
- expiresIn: string;
134
- provider: string;
135
- }
136
150
  interface IAuthenticationDataModel {
137
151
  access_token: string;
138
152
  applicationid: string;
@@ -153,56 +167,6 @@ interface IAuthenticationDataModel {
153
167
  fullname?: string;
154
168
  picture?: string;
155
169
  }
156
- declare class AXCAPIOidcStrategy extends AXPAuthStrategy {
157
- private aXMAuthConfigs;
158
- private oauthService;
159
- private http;
160
- private sessionService;
161
- userInfo: any;
162
- authConfig: AuthConfig;
163
- openidConfigurationInfo: any;
164
- configureOAuth(): Promise<void>;
165
- signin(credentials: AXPBaseCredentials): Promise<AXPSignInResult>;
166
- /**
167
- * Handles OIDC password-based authentication
168
- */
169
- private handleOidcPasswordSignin;
170
- signout(): Promise<void>;
171
- refreshToken(context: AXPSessionContext): Promise<AXPRefreshTokenResult>;
172
- /**
173
- * Starts the OIDC authorization code flow, redirecting to the authorize endpoint with tenant_id and application_id as query params.
174
- */
175
- startAuthorizationFlow(tenantId: string, applicationId: string): Promise<void>;
176
- /**
177
- * Unified method to complete the authorization code flow.
178
- */
179
- completeAuthorizationCodeFlow(options: {
180
- code: string;
181
- redirectUri: string;
182
- clientId?: string;
183
- tokenEndpoint?: string;
184
- }): Promise<void>;
185
- private generateRandomString;
186
- private generateCodeChallenge;
187
- private base64UrlEncode;
188
- expires_in_milisecound(expires_in_date: string): number;
189
- private loadAuthData;
190
- loadUserInfo(): Promise<object>;
191
- calculateExpireInDate(expireInMilisecound: number): string;
192
- private handleError;
193
- get name(): string;
194
- static ɵfac: i0.ɵɵFactoryDeclaration<AXCAPIOidcStrategy, never>;
195
- static ɵprov: i0.ɵɵInjectableDeclaration<AXCAPIOidcStrategy>;
196
- }
197
- declare class JwtUtil {
198
- /**
199
- * Decodes a JWT token and returns its payload as an object.
200
- * @param token JWT string
201
- */
202
- static parseJwt(token: string): any;
203
- static createJwt(payload: any): string;
204
- static base64url(obj: any): string;
205
- }
206
170
 
207
171
  declare class AXMOidcPermissionLoader implements AXPPermissionLoader {
208
172
  private http;
@@ -227,5 +191,5 @@ declare class AXMOidcTenantLoader implements AXPTenantLoader {
227
191
  static ɵprov: i0.ɵɵInjectableDeclaration<AXMOidcTenantLoader>;
228
192
  }
229
193
 
230
- export { AXCAPIOidcStrategy, AXCApiEntityStorageService, AXCApiModule, AXMConfigurationService, AXMOidcApplicationLoader, AXMOidcFeatureLoader, AXMOidcPermissionLoader, AXMOidcTenantLoader, JwtUtil };
231
- export type { AXPOAuthExternalCredentials, AXPUserPassCredentials, ApplicationConfiguration, Auth, Culture, IAuthenticationDataModel, Language, Localization, NameValue, Resource };
194
+ export { AXCApiEntityStorageService, AXCApiModule, AXMConfigurationService, AXMOidcApplicationLoader, AXMOidcFeatureLoader, AXMOidcPermissionLoader, AXMOidcStrategy, AXMOidcTenantLoader };
195
+ export type { AXPUserPassCredentials, ApplicationConfiguration, Auth, Culture, IAuthenticationDataModel, Language, Localization, NameValue, Resource };