@thunderid/javascript 0.0.4 → 0.0.5

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,485 +0,0 @@
1
- /**
2
- * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
3
- *
4
- * WSO2 LLC. licenses this file to you under the Apache License,
5
- * Version 2.0 (the "License"); you may not use this file except
6
- * in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
- import { AuthClientConfig } from './models';
19
- import { IsomorphicCrypto } from '../IsomorphicCrypto';
20
- import { Crypto } from '../models/crypto';
21
- import { ExtendedAuthorizeRequestUrlParams } from '../models/oauth-request';
22
- import { OIDCEndpoints } from '../models/oidc-endpoints';
23
- import { UserSession } from '../models/session';
24
- import { Storage } from '../models/store';
25
- import { TokenResponse, IdToken, TokenExchangeRequestConfig } from '../models/token';
26
- import { User } from '../models/user';
27
- import StorageManager from '../StorageManager';
28
- /**
29
- * This class provides the necessary methods needed to implement authentication.
30
- */
31
- export declare class ThunderIDAuthClient<T> {
32
- private storageManager;
33
- private configProvider;
34
- private oidcProviderMetaDataProvider;
35
- private authHelper;
36
- private cryptoUtils;
37
- private cryptoHelper;
38
- private instanceIdValue;
39
- static authHelperInstance: any;
40
- /**
41
- * This is the constructor method that returns an instance of the .
42
- *
43
- * @param store - The store object.
44
- *
45
- * @example
46
- * ```
47
- * const _store: Store = new DataStore();
48
- * const auth = new ThunderIDAuthClient<CustomClientConfig>(_store);
49
- * ```
50
- *
51
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#constructor}
52
- *
53
- * @preserve
54
- */
55
- constructor();
56
- /**
57
- *
58
- * This method initializes the SDK with the config data.
59
- *
60
- * @param config - The config object to initialize with.
61
- *
62
- * @example
63
- * const config = \{
64
- * afterSignInUrl: "http://localhost:3000/sign-in",
65
- * clientId: "client ID",
66
- * baseUrl: "https://localhost:9443"
67
- * \}
68
- *
69
- * await auth.initialize(config);
70
- *
71
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#initialize}
72
- *
73
- * @preserve
74
- */
75
- initialize(config: AuthClientConfig<T>, store: Storage, inputCryptoUtils: Crypto, instanceID?: number): Promise<void>;
76
- /**
77
- * This method returns the `StorageManager` object that allows you to access authentication data.
78
- *
79
- * @returns - The `StorageManager` object.
80
- *
81
- * @example
82
- * ```
83
- * const data = auth.getStorageManager();
84
- * ```
85
- *
86
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getStorageManager}
87
- *
88
- * @preserve
89
- */
90
- getStorageManager(): StorageManager<T>;
91
- /**
92
- * This method returns the `instanceID` variable of the given instance.
93
- *
94
- * @returns - The `instanceID` number.
95
- *
96
- * @example
97
- * ```
98
- * const instanceId = auth.getInstanceId();
99
- * ```
100
- *
101
- * @preserve
102
- */
103
- getInstanceId(): number;
104
- /**
105
- * This is an async method that returns a Promise that resolves with the authorization URL.
106
- *
107
- * @param config - (Optional) A config object to force initialization and pass
108
- * custom path parameters such as the fidp parameter.
109
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
110
- * scenarios where each user should be uniquely identified.
111
- *
112
- * @returns - A promise that resolves with the authorization URL.
113
- *
114
- * @example
115
- * ```
116
- * auth.getSignInUrl().then((url)=>{
117
- * // console.log(url);
118
- * }).catch((error)=>{
119
- * // console.error(error);
120
- * });
121
- * ```
122
- *
123
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getSignInUrl}
124
- *
125
- * @preserve
126
- */
127
- getSignInUrl(requestConfig?: ExtendedAuthorizeRequestUrlParams, userId?: string): Promise<string>;
128
- /**
129
- * This is an async method that sends a request to obtain the access token and returns a Promise
130
- * that resolves with the token and other relevant data.
131
- *
132
- * @param authorizationCode - The authorization code.
133
- * @param sessionState - The session state.
134
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
135
- * scenarios where each user should be uniquely identified.
136
- *
137
- * @returns - A Promise that resolves with the token response.
138
- *
139
- * @example
140
- * ```
141
- * auth.requestAccessToken(authCode, sessionState).then((token)=>{
142
- * // console.log(token);
143
- * }).catch((error)=>{
144
- * // console.error(error);
145
- * });
146
- * ```
147
- *
148
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#requestAccessToken}
149
- *
150
- *
151
- * @preserve
152
- */
153
- requestAccessToken(authorizationCode: string, sessionState: string, state: string, userId?: string, tokenRequestConfig?: {
154
- params: Record<string, unknown>;
155
- }): Promise<TokenResponse>;
156
- loadOpenIDProviderConfiguration(forceInit: boolean): Promise<void>;
157
- /**
158
- * This method returns the sign-out URL.
159
- *
160
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
161
- * scenarios where each user should be uniquely identified.
162
- *
163
- * **This doesn't clear the authentication data.**
164
- *
165
- * @returns - A Promise that resolves with the sign-out URL.
166
- *
167
- * @example
168
- * ```
169
- * const signOutUrl = await auth.getSignOutUrl();
170
- * ```
171
- *
172
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getSignOutUrl}
173
- *
174
- * @preserve
175
- */
176
- getSignOutUrl(userId?: string): Promise<string>;
177
- /**
178
- * This method returns OIDC service endpoints that are fetched from the `.well-known` endpoint.
179
- *
180
- * @returns - A Promise that resolves with an object containing the OIDC service endpoints.
181
- *
182
- * @example
183
- * ```
184
- * const endpoints = await auth.getOpenIDProviderEndpoints();
185
- * ```
186
- *
187
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getOpenIDProviderEndpoints}
188
- *
189
- * @preserve
190
- */
191
- getOpenIDProviderEndpoints(): Promise<Partial<OIDCEndpoints>>;
192
- /**
193
- * This method decodes a given JWT token and returns the payload.
194
- *
195
- * @param token - The token to be decoded.
196
- * @returns - A Promise that resolves with the decoded token payload.
197
- *
198
- * @example
199
- * ```
200
- * const decodedToken = await auth.decodeJwtToken(token);
201
- * ```
202
- */
203
- decodeJwtToken<U = Record<string, unknown>>(token: string): Promise<U>;
204
- /**
205
- * This method decodes the payload of the ID token and returns it.
206
- *
207
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
208
- * scenarios where each user should be uniquely identified.
209
- *
210
- * @returns - A Promise that resolves with the decoded ID token payload.
211
- *
212
- * @example
213
- * ```
214
- * const decodedIdToken = await auth.getDecodedIdToken();
215
- * ```
216
- *
217
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getDecodedIdToken}
218
- *
219
- * @preserve
220
- */
221
- getDecodedIdToken(userId?: string, idToken?: string): Promise<IdToken>;
222
- /**
223
- * This method returns the ID token.
224
- *
225
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
226
- * scenarios where each user should be uniquely identified.
227
- *
228
- * @returns - A Promise that resolves with the ID token.
229
- *
230
- * @example
231
- * ```
232
- * const idToken = await auth.getIdToken();
233
- * ```
234
- *
235
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getIdToken}
236
- *
237
- * @preserve
238
- */
239
- getIdToken(userId?: string): Promise<string>;
240
- /**
241
- * This method returns the basic user information obtained from the ID token.
242
- *
243
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
244
- * scenarios where each user should be uniquely identified.
245
- *
246
- * @returns - A Promise that resolves with an object containing the basic user information.
247
- *
248
- * @example
249
- * ```
250
- * const userInfo = await auth.getUser();
251
- * ```
252
- *
253
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getUser}
254
- *
255
- * @preserve
256
- */
257
- getUser(userId?: string): Promise<User>;
258
- getUserSession(userId?: string): Promise<UserSession>;
259
- /**
260
- * This method returns the crypto helper object.
261
- *
262
- * @returns - A Promise that resolves with a IsomorphicCrypto object.
263
- *
264
- * @example
265
- * ```
266
- * const cryptoHelper = await auth.IsomorphicCrypto();
267
- * ```
268
- *
269
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getCrypto}
270
- *
271
- * @preserve
272
- */
273
- getCrypto(): Promise<IsomorphicCrypto>;
274
- /**
275
- * This method revokes the access token.
276
- *
277
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
278
- * scenarios where each user should be uniquely identified.
279
- *
280
- * **This method also clears the authentication data.**
281
- *
282
- * @returns - A Promise that returns the response of the revoke-access-token request.
283
- *
284
- * @example
285
- * ```
286
- * auth.revokeAccessToken().then((response)=>{
287
- * // console.log(response);
288
- * }).catch((error)=>{
289
- * // console.error(error);
290
- * });
291
- * ```
292
- *
293
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#revokeAccessToken}
294
- *
295
- * @preserve
296
- */
297
- revokeAccessToken(userId?: string): Promise<Response>;
298
- /**
299
- * This method refreshes the access token and returns a Promise that resolves with the new access
300
- * token and other relevant data.
301
- *
302
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
303
- * scenarios where each user should be uniquely identified.
304
- *
305
- * @returns - A Promise that resolves with the token response.
306
- *
307
- * @example
308
- * ```
309
- * auth.refreshAccessToken().then((response)=>{
310
- * // console.log(response);
311
- * }).catch((error)=>{
312
- * // console.error(error);
313
- * });
314
- * ```
315
- *
316
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#refreshAccessToken}
317
- *
318
- * @preserve
319
- */
320
- refreshAccessToken(userId?: string): Promise<TokenResponse>;
321
- /**
322
- * This method returns the access token.
323
- *
324
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
325
- * scenarios where each user should be uniquely identified.
326
- *
327
- * @returns - A Promise that resolves with the access token.
328
- *
329
- * @example
330
- * ```
331
- * const accessToken = await auth.getAccessToken();
332
- * ```
333
- *
334
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getAccessToken}
335
- *
336
- * @preserve
337
- */
338
- getAccessToken(userId?: string): Promise<string>;
339
- /**
340
- * This method sends a custom-grant request and returns a Promise that resolves with the response
341
- * depending on the config passed.
342
- *
343
- * @param config - A config object containing the custom grant configurations.
344
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
345
- * scenarios where each user should be uniquely identified.
346
- *
347
- * @returns - A Promise that resolves with the response depending
348
- * on your configurations.
349
- *
350
- * @example
351
- * ```
352
- * const config = {
353
- * attachToken: false,
354
- * data: {
355
- * client_id: "{{clientId}}",
356
- * grant_type: "account_switch",
357
- * scope: "{{scope}}",
358
- * token: "{{token}}",
359
- * },
360
- * id: "account-switch",
361
- * returnResponse: true,
362
- * returnsSession: true,
363
- * signInRequired: true
364
- * }
365
- *
366
- * auth.exchangeToken(config).then((response)=>{
367
- * // console.log(response);
368
- * }).catch((error)=>{
369
- * // console.error(error);
370
- * });
371
- * ```
372
- *
373
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#exchangeToken}
374
- *
375
- * @preserve
376
- */
377
- exchangeToken(config: TokenExchangeRequestConfig, userId?: string): Promise<TokenResponse | Response>;
378
- /**
379
- * This method returns if the user is authenticated or not.
380
- *
381
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
382
- * scenarios where each user should be uniquely identified.
383
- *
384
- * @returns - A Promise that resolves with `true` if the user is authenticated, `false` otherwise.
385
- *
386
- * @example
387
- * ```
388
- * await auth.isSignedIn();
389
- * ```
390
- *
391
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#isSignedIn}
392
- *
393
- * @preserve
394
- */
395
- isSignedIn(userId?: string): Promise<boolean>;
396
- /**
397
- * This method returns the PKCE code generated during the generation of the authentication URL.
398
- *
399
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
400
- * scenarios where each user should be uniquely identified.
401
- * @param state - The state parameter that was passed in the authentication URL.
402
- *
403
- * @returns - A Promise that resolves with the PKCE code.
404
- *
405
- * @example
406
- * ```
407
- * const pkce = await getPKCECode();
408
- * ```
409
- *
410
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getPKCECode}
411
- *
412
- * @preserve
413
- */
414
- getPKCECode(state: string, userId?: string): Promise<string>;
415
- /**
416
- * This method sets the PKCE code to the data store.
417
- *
418
- * @param pkce - The PKCE code.
419
- * @param state - The state parameter that was passed in the authentication URL.
420
- * @param userId - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user
421
- * scenarios where each user should be uniquely identified.
422
- *
423
- * @example
424
- * ```
425
- * await auth.setPKCECode("pkce_code")
426
- * ```
427
- *
428
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#setPKCECode}
429
- *
430
- * @preserve
431
- */
432
- setPKCECode(pkce: string, state: string, userId?: string): Promise<void>;
433
- /**
434
- * This method returns if the sign-out is successful or not.
435
- *
436
- * @param signOutRedirectUrl - The URL to which the user has been redirected to after signing-out.
437
- *
438
- * **The server appends path parameters to the `afterSignOutUrl` and these path parameters
439
- * are required for this method to function.**
440
- *
441
- * @returns - `true` if successful, `false` otherwise.
442
- *
443
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#isSignOutSuccessful}
444
- *
445
- * @preserve
446
- */
447
- static isSignOutSuccessful(afterSignOutUrl: string): boolean;
448
- /**
449
- * This method returns if the sign-out has failed or not.
450
- *
451
- * @param signOutRedirectUrl - The URL to which the user has been redirected to after signing-out.
452
- *
453
- * **The server appends path parameters to the `afterSignOutUrl` and these path parameters
454
- * are required for this method to function.**
455
- *
456
- * @returns - `true` if successful, `false` otherwise.
457
- *
458
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#didSignOutFail}
459
- *
460
- * @preserve
461
- */
462
- static didSignOutFail(afterSignOutUrl: string): boolean;
463
- /**
464
- * This method updates the configuration that was passed into the constructor when instantiating this class.
465
- *
466
- * @param config - A config object to update the SDK configurations with.
467
- *
468
- * @example
469
- * ```
470
- * const config = {
471
- * afterSignInUrl: "http://localhost:3000/sign-in",
472
- * clientId: "client ID",
473
- * baseUrl: "https://localhost:9443"
474
- * }
475
- *
476
- * await auth.reInitialize(config);
477
- * ```
478
- * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#reInitialize}
479
- *
480
- * @preserve
481
- */
482
- reInitialize(config: Partial<AuthClientConfig<T>>): Promise<void>;
483
- static clearSession(userId?: string): Promise<void>;
484
- }
485
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/__legacy__/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,gBAAgB,EAAyB,MAAM,UAAU,CAAC;AAMlE,OAAO,EAAC,gBAAgB,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAC,iCAAiC,EAAC,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAc,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAC,OAAO,EAAiB,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,aAAa,EAAE,OAAO,EAAE,0BAA0B,EAAC,MAAM,iBAAiB,CAAC;AAEnF,OAAO,EAAC,IAAI,EAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAwB/C;;GAEG;AACH,qBAAa,mBAAmB,CAAC,CAAC;IAChC,OAAO,CAAC,cAAc,CAAqB;IAE3C,OAAO,CAAC,cAAc,CAAkC;IAExD,OAAO,CAAC,4BAA4B,CAA0C;IAE9E,OAAO,CAAC,UAAU,CAA0B;IAE5C,OAAO,CAAC,WAAW,CAA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AAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOzE;;;;;;;;;;;;;;;;OAgBG;IACU,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrF;;;;;;;;;;;;;OAaG;WACW,mBAAmB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO;IAQnE;;;;;;;;;;;;;OAaG;WACW,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO;IAQ9D;;;;;;;;;;;;;;;;;;OAkBG;IACU,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;WAQ1D,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGjE"}
@@ -1,38 +0,0 @@
1
- /**
2
- * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
3
- *
4
- * WSO2 LLC. licenses this file to you under the Apache License,
5
- * Version 2.0 (the "License"); you may not use this file except
6
- * in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
- import { IsomorphicCrypto } from '../../IsomorphicCrypto';
19
- import { OIDCDiscoveryEndpointsApiResponse, OIDCDiscoveryApiResponse } from '../../models/oidc-discovery';
20
- import { TokenResponse } from '../../models/token';
21
- import { User } from '../../models/user';
22
- import StorageManager from '../../StorageManager';
23
- export declare class AuthenticationHelper<T> {
24
- private storageManager;
25
- private config;
26
- private oidcProviderMetaData;
27
- private cryptoHelper;
28
- constructor(storageManagerInstance: StorageManager<T>, cryptoHelperInstance: IsomorphicCrypto);
29
- resolveEndpoints(response: OIDCDiscoveryApiResponse): Promise<OIDCDiscoveryApiResponse>;
30
- resolveEndpointsExplicitly(): Promise<OIDCDiscoveryEndpointsApiResponse>;
31
- resolveEndpointsByBaseURL(): Promise<OIDCDiscoveryEndpointsApiResponse>;
32
- validateIdToken(idToken: string): Promise<boolean>;
33
- getAuthenticatedUserInfo(idToken: string): User;
34
- replaceCustomGrantTemplateTags(text: string, userId?: string): Promise<string>;
35
- clearSession(userId?: string): Promise<void>;
36
- handleTokenResponse(response: Response, userId?: string): Promise<TokenResponse>;
37
- }
38
- //# sourceMappingURL=authentication-helper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authentication-helper.d.ts","sourceRoot":"","sources":["../../../src/__legacy__/helpers/authentication-helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,EAAC,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AAGxD,OAAO,EAAC,iCAAiC,EAAE,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AAGxG,OAAO,EAAU,aAAa,EAAyB,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AACvC,OAAO,cAAc,MAAM,sBAAsB,CAAC;AAKlD,qBAAa,oBAAoB,CAAC,CAAC;IACjC,OAAO,CAAC,cAAc,CAAoB;IAE1C,OAAO,CAAC,MAAM,CAAkC;IAEhD,OAAO,CAAC,oBAAoB,CAA0C;IAEtE,OAAO,CAAC,YAAY,CAAmB;gBAEpB,sBAAsB,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,oBAAoB,EAAE,gBAAgB;IAQvF,gBAAgB,CAAC,QAAQ,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAevF,0BAA0B,IAAI,OAAO,CAAC,iCAAiC,CAAC;IAkDxE,yBAAyB,IAAI,OAAO,CAAC,iCAAiC,CAAC;IAqDvE,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAsDxD,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAezC,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IA6C9E,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5C,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CA+C9F"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
3
- *
4
- * WSO2 LLC. licenses this file to you under the Apache License,
5
- * Version 2.0 (the "License"); you may not use this file except
6
- * in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
- export * from './authentication-helper';
19
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/__legacy__/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,yBAAyB,CAAC"}
@@ -1,106 +0,0 @@
1
- /**
2
- * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.
3
- *
4
- * WSO2 LLC. licenses this file to you under the Apache License,
5
- * Version 2.0 (the "License"); you may not use this file except
6
- * in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
- import { OAuthResponseMode } from '../../models/oauth-response';
19
- import { OIDCEndpoints } from '../../models/oidc-endpoints';
20
- import { Platform } from '../../models/platforms';
21
- import { TokenEndpointAuthMethod } from '../../models/token-endpoint-auth';
22
- export interface DefaultAuthClientConfig {
23
- afterSignInUrl: string;
24
- afterSignOutUrl?: string;
25
- /**
26
- * Application UUID for the client.
27
- */
28
- applicationId?: string;
29
- clientHost?: string;
30
- clientId?: string;
31
- clientSecret?: string;
32
- enablePKCE?: boolean;
33
- organizationChain?: {
34
- /**
35
- * Instance ID of the source organization context to retrieve access token from for organization token exchange.
36
- * Used in linked organization scenarios to automatically fetch the source organization's access token.
37
- */
38
- sourceInstanceId?: number;
39
- /**
40
- * Organization ID for the target organization.
41
- * When provided with sourceInstanceId, triggers automatic organization token exchange.
42
- */
43
- targetOrganizationId?: string;
44
- };
45
- /**
46
- * Optional platform where the application is running.
47
- * This helps the SDK to optimize its behavior based on the platform.
48
- * If not provided, the SDK will attempt to auto-detect the platform.
49
- */
50
- platform?: keyof typeof Platform;
51
- prompt?: string;
52
- responseMode?: OAuthResponseMode;
53
- scopes?: string | string[] | undefined;
54
- /**
55
- * Specifies if cookies should be sent with access-token requests, refresh-token requests,
56
- * custom-grant requests, etc.
57
- *
58
- */
59
- sendCookiesInRequests?: boolean;
60
- sendIdTokenInLogoutRequest?: boolean;
61
- tokenRequest?: {
62
- /**
63
- * OAuth 2.0 client authentication method used at the token endpoint.
64
- * When omitted, defaults to `client_secret_basic` for ThunderIDV2 and
65
- * `client_secret_post` for all other platforms.
66
- */
67
- authMethod?: TokenEndpointAuthMethod;
68
- };
69
- tokenValidation?: {
70
- /**
71
- * ID token validation config.
72
- */
73
- idToken?: {
74
- /**
75
- * Allowed leeway for ID tokens (in seconds).
76
- */
77
- clockTolerance?: number;
78
- /**
79
- * Whether to validate ID tokens.
80
- */
81
- validate?: boolean;
82
- /**
83
- * Whether to validate the issuer of ID tokens.
84
- */
85
- validateIssuer?: boolean;
86
- };
87
- };
88
- }
89
- export interface WellKnownAuthClientConfig extends DefaultAuthClientConfig {
90
- baseUrl?: string;
91
- endpoints?: Partial<OIDCEndpoints>;
92
- wellKnownEndpoint: string;
93
- }
94
- export interface BaseURLAuthClientConfig extends DefaultAuthClientConfig {
95
- baseUrl: string;
96
- endpoints?: Partial<OIDCEndpoints>;
97
- wellKnownEndpoint?: string;
98
- }
99
- export interface ExplicitAuthClientConfig extends DefaultAuthClientConfig {
100
- baseUrl?: string;
101
- endpoints: OIDCEndpoints;
102
- wellKnownEndpoint?: string;
103
- }
104
- export type StrictAuthClientConfig = WellKnownAuthClientConfig | BaseURLAuthClientConfig | ExplicitAuthClientConfig;
105
- export type AuthClientConfig<T = unknown> = StrictAuthClientConfig & T;
106
- //# sourceMappingURL=client-config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-config.d.ts","sourceRoot":"","sources":["../../../src/__legacy__/models/client-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAC,uBAAuB,EAAC,MAAM,kCAAkC,CAAC;AAEzE,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAA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