@thunderid/javascript 0.0.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/LICENSE +201 -0
- package/dist/DefaultCacheStore.d.ts +31 -0
- package/dist/DefaultCacheStore.d.ts.map +1 -0
- package/dist/DefaultCrypto.d.ts +30 -0
- package/dist/DefaultCrypto.d.ts.map +1 -0
- package/dist/HttpClient.d.ts +65 -0
- package/dist/HttpClient.d.ts.map +1 -0
- package/dist/IsomorphicCrypto.d.ts +64 -0
- package/dist/IsomorphicCrypto.d.ts.map +1 -0
- package/dist/StorageManager.d.ts +66 -0
- package/dist/StorageManager.d.ts.map +1 -0
- package/dist/ThunderIDJavaScriptClient.d.ts +66 -0
- package/dist/ThunderIDJavaScriptClient.d.ts.map +1 -0
- package/dist/__legacy__/client.d.ts +485 -0
- package/dist/__legacy__/client.d.ts.map +1 -0
- package/dist/__legacy__/helpers/authentication-helper.d.ts +38 -0
- package/dist/__legacy__/helpers/authentication-helper.d.ts.map +1 -0
- package/dist/__legacy__/helpers/index.d.ts +19 -0
- package/dist/__legacy__/helpers/index.d.ts.map +1 -0
- package/dist/__legacy__/models/client-config.d.ts +106 -0
- package/dist/__legacy__/models/client-config.d.ts.map +1 -0
- package/dist/__legacy__/models/index.d.ts +19 -0
- package/dist/__legacy__/models/index.d.ts.map +1 -0
- package/dist/api/createOrganization.d.ts +130 -0
- package/dist/api/createOrganization.d.ts.map +1 -0
- package/dist/api/executeEmbeddedSignInFlow.d.ts +22 -0
- package/dist/api/executeEmbeddedSignInFlow.d.ts.map +1 -0
- package/dist/api/executeEmbeddedSignUpFlow.d.ts +45 -0
- package/dist/api/executeEmbeddedSignUpFlow.d.ts.map +1 -0
- package/dist/api/getAllOrganizations.d.ts +104 -0
- package/dist/api/getAllOrganizations.d.ts.map +1 -0
- package/dist/api/getBrandingPreference.d.ts +104 -0
- package/dist/api/getBrandingPreference.d.ts.map +1 -0
- package/dist/api/getMeOrganizations.d.ts +120 -0
- package/dist/api/getMeOrganizations.d.ts.map +1 -0
- package/dist/api/getOrganization.d.ts +110 -0
- package/dist/api/getOrganization.d.ts.map +1 -0
- package/dist/api/getSchemas.d.ts +90 -0
- package/dist/api/getSchemas.d.ts.map +1 -0
- package/dist/api/getScim2Me.d.ts +90 -0
- package/dist/api/getScim2Me.d.ts.map +1 -0
- package/dist/api/getUserInfo.d.ts +38 -0
- package/dist/api/getUserInfo.d.ts.map +1 -0
- package/dist/api/initializeEmbeddedSignInFlow.d.ts +52 -0
- package/dist/api/initializeEmbeddedSignInFlow.d.ts.map +1 -0
- package/dist/api/updateMeProfile.d.ts +83 -0
- package/dist/api/updateMeProfile.d.ts.map +1 -0
- package/dist/api/updateOrganization.d.ts +119 -0
- package/dist/api/updateOrganization.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedRecoveryFlowV2.d.ts +57 -0
- package/dist/api/v2/executeEmbeddedRecoveryFlowV2.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedSignInFlowV2.d.ts +22 -0
- package/dist/api/v2/executeEmbeddedSignInFlowV2.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedSignUpFlowV2.d.ts +22 -0
- package/dist/api/v2/executeEmbeddedSignUpFlowV2.d.ts.map +1 -0
- package/dist/api/v2/executeEmbeddedUserOnboardingFlowV2.d.ts +89 -0
- package/dist/api/v2/executeEmbeddedUserOnboardingFlowV2.d.ts.map +1 -0
- package/dist/api/v2/getFlowMetaV2.d.ts +56 -0
- package/dist/api/v2/getFlowMetaV2.d.ts.map +1 -0
- package/dist/api/v2/getOrganizationUnitChildren.d.ts +43 -0
- package/dist/api/v2/getOrganizationUnitChildren.d.ts.map +1 -0
- package/dist/cjs/index.cjs +7693 -0
- package/dist/constants/ApplicationNativeAuthenticationConstants.d.ts +40 -0
- package/dist/constants/ApplicationNativeAuthenticationConstants.d.ts.map +1 -0
- package/dist/constants/OIDCDiscoveryConstants.d.ts +65 -0
- package/dist/constants/OIDCDiscoveryConstants.d.ts.map +1 -0
- package/dist/constants/OIDCRequestConstants.d.ts +43 -0
- package/dist/constants/OIDCRequestConstants.d.ts.map +1 -0
- package/dist/constants/PKCEConstants.d.ts +45 -0
- package/dist/constants/PKCEConstants.d.ts.map +1 -0
- package/dist/constants/ScopeConstants.d.ts +43 -0
- package/dist/constants/ScopeConstants.d.ts.map +1 -0
- package/dist/constants/TokenConstants.d.ts +48 -0
- package/dist/constants/TokenConstants.d.ts.map +1 -0
- package/dist/constants/TokenExchangeConstants.d.ts +44 -0
- package/dist/constants/TokenExchangeConstants.d.ts.map +1 -0
- package/dist/constants/VendorConstants.d.ts +32 -0
- package/dist/constants/VendorConstants.d.ts.map +1 -0
- package/dist/constants/v2/OIDCDiscoveryConstants.d.ts +40 -0
- package/dist/constants/v2/OIDCDiscoveryConstants.d.ts.map +1 -0
- package/dist/edge/index.js +7568 -0
- package/dist/errors/ThunderIDAPIError.d.ts +59 -0
- package/dist/errors/ThunderIDAPIError.d.ts.map +1 -0
- package/dist/errors/ThunderIDError.d.ts +50 -0
- package/dist/errors/ThunderIDError.d.ts.map +1 -0
- package/dist/errors/ThunderIDRuntimeError.d.ts +51 -0
- package/dist/errors/ThunderIDRuntimeError.d.ts.map +1 -0
- package/dist/errors/exception.d.ts +27 -0
- package/dist/errors/exception.d.ts.map +1 -0
- package/dist/i18n/constants/TranslationBundleConstants.d.ts +35 -0
- package/dist/i18n/constants/TranslationBundleConstants.d.ts.map +1 -0
- package/dist/i18n/models/i18n.d.ts +127 -0
- package/dist/i18n/models/i18n.d.ts.map +1 -0
- package/dist/i18n/translations/en-US.d.ts +21 -0
- package/dist/i18n/translations/en-US.d.ts.map +1 -0
- package/dist/i18n/translations/fr-FR.d.ts +21 -0
- package/dist/i18n/translations/fr-FR.d.ts.map +1 -0
- package/dist/i18n/translations/hi-IN.d.ts +21 -0
- package/dist/i18n/translations/hi-IN.d.ts.map +1 -0
- package/dist/i18n/translations/index.d.ts +26 -0
- package/dist/i18n/translations/index.d.ts.map +1 -0
- package/dist/i18n/translations/ja-JP.d.ts +21 -0
- package/dist/i18n/translations/ja-JP.d.ts.map +1 -0
- package/dist/i18n/translations/pt-BR.d.ts +21 -0
- package/dist/i18n/translations/pt-BR.d.ts.map +1 -0
- package/dist/i18n/translations/pt-PT.d.ts +21 -0
- package/dist/i18n/translations/pt-PT.d.ts.map +1 -0
- package/dist/i18n/translations/si-LK.d.ts +21 -0
- package/dist/i18n/translations/si-LK.d.ts.map +1 -0
- package/dist/i18n/translations/ta-IN.d.ts +21 -0
- package/dist/i18n/translations/ta-IN.d.ts.map +1 -0
- package/dist/i18n/translations/te-IN.d.ts +21 -0
- package/dist/i18n/translations/te-IN.d.ts.map +1 -0
- package/dist/i18n/utils/getDefaultI18nBundles.d.ts +28 -0
- package/dist/i18n/utils/getDefaultI18nBundles.d.ts.map +1 -0
- package/dist/i18n/utils/normalizeTranslations.d.ts +42 -0
- package/dist/i18n/utils/normalizeTranslations.d.ts.map +1 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7568 -0
- package/dist/models/agent.d.ts +45 -0
- package/dist/models/agent.d.ts.map +1 -0
- package/dist/models/auth-code-response.d.ts +35 -0
- package/dist/models/auth-code-response.d.ts.map +1 -0
- package/dist/models/branding-preference.d.ts +249 -0
- package/dist/models/branding-preference.d.ts.map +1 -0
- package/dist/models/client.d.ts +213 -0
- package/dist/models/client.d.ts.map +1 -0
- package/dist/models/config.d.ts +483 -0
- package/dist/models/config.d.ts.map +1 -0
- package/dist/models/crypto.d.ts +101 -0
- package/dist/models/crypto.d.ts.map +1 -0
- package/dist/models/embedded-flow.d.ts +167 -0
- package/dist/models/embedded-flow.d.ts.map +1 -0
- package/dist/models/embedded-signin-flow.d.ts +100 -0
- package/dist/models/embedded-signin-flow.d.ts.map +1 -0
- package/dist/models/field.d.ts +32 -0
- package/dist/models/field.d.ts.map +1 -0
- package/dist/models/flow.d.ts +31 -0
- package/dist/models/flow.d.ts.map +1 -0
- package/dist/models/http.d.ts +46 -0
- package/dist/models/http.d.ts.map +1 -0
- package/dist/models/oauth-request.d.ts +24 -0
- package/dist/models/oauth-request.d.ts.map +1 -0
- package/dist/models/oauth-response.d.ts +19 -0
- package/dist/models/oauth-response.d.ts.map +1 -0
- package/dist/models/oidc-discovery.d.ts +370 -0
- package/dist/models/oidc-discovery.d.ts.map +1 -0
- package/dist/models/oidc-endpoints.d.ts +72 -0
- package/dist/models/oidc-endpoints.d.ts.map +1 -0
- package/dist/models/organization.d.ts +34 -0
- package/dist/models/organization.d.ts.map +1 -0
- package/dist/models/platforms.d.ts +38 -0
- package/dist/models/platforms.d.ts.map +1 -0
- package/dist/models/scim2-schema.d.ts +66 -0
- package/dist/models/scim2-schema.d.ts.map +1 -0
- package/dist/models/session.d.ts +32 -0
- package/dist/models/session.d.ts.map +1 -0
- package/dist/models/store.d.ts +84 -0
- package/dist/models/store.d.ts.map +1 -0
- package/dist/models/token-endpoint-auth.d.ts +30 -0
- package/dist/models/token-endpoint-auth.d.ts.map +1 -0
- package/dist/models/token.d.ts +181 -0
- package/dist/models/token.d.ts.map +1 -0
- package/dist/models/user.d.ts +34 -0
- package/dist/models/user.d.ts.map +1 -0
- package/dist/models/utility-types.d.ts +21 -0
- package/dist/models/utility-types.d.ts.map +1 -0
- package/dist/models/v2/embedded-flow-v2.d.ts +494 -0
- package/dist/models/v2/embedded-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/embedded-recovery-flow-v2.d.ts +143 -0
- package/dist/models/v2/embedded-recovery-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/embedded-signin-flow-v2.d.ts +340 -0
- package/dist/models/v2/embedded-signin-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/embedded-signup-flow-v2.d.ts +272 -0
- package/dist/models/v2/embedded-signup-flow-v2.d.ts.map +1 -0
- package/dist/models/v2/extensions/components.d.ts +89 -0
- package/dist/models/v2/extensions/components.d.ts.map +1 -0
- package/dist/models/v2/flow-meta-v2.d.ts +299 -0
- package/dist/models/v2/flow-meta-v2.d.ts.map +1 -0
- package/dist/models/v2/organization-unit.d.ts +103 -0
- package/dist/models/v2/organization-unit.d.ts.map +1 -0
- package/dist/models/v2/translation.d.ts +35 -0
- package/dist/models/v2/translation.d.ts.map +1 -0
- package/dist/models/v2/vars.d.ts +36 -0
- package/dist/models/v2/vars.d.ts.map +1 -0
- package/dist/theme/createTheme.d.ts +23 -0
- package/dist/theme/createTheme.d.ts.map +1 -0
- package/dist/theme/types.d.ts +381 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/utils/arrayBufferToBase64url.d.ts +49 -0
- package/dist/utils/arrayBufferToBase64url.d.ts.map +1 -0
- package/dist/utils/base64Encode.d.ts +36 -0
- package/dist/utils/base64Encode.d.ts.map +1 -0
- package/dist/utils/base64urlToArrayBuffer.d.ts +56 -0
- package/dist/utils/base64urlToArrayBuffer.d.ts.map +1 -0
- package/dist/utils/bem.d.ts +47 -0
- package/dist/utils/bem.d.ts.map +1 -0
- package/dist/utils/deepMerge.d.ts +45 -0
- package/dist/utils/deepMerge.d.ts.map +1 -0
- package/dist/utils/deriveOrganizationHandleFromBaseUrl.d.ts +48 -0
- package/dist/utils/deriveOrganizationHandleFromBaseUrl.d.ts.map +1 -0
- package/dist/utils/extractPkceStorageKeyFromState.d.ts +33 -0
- package/dist/utils/extractPkceStorageKeyFromState.d.ts.map +1 -0
- package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts +32 -0
- package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts.map +1 -0
- package/dist/utils/extractUserClaimsFromIdToken.d.ts +47 -0
- package/dist/utils/extractUserClaimsFromIdToken.d.ts.map +1 -0
- package/dist/utils/flattenUserSchema.d.ts +65 -0
- package/dist/utils/flattenUserSchema.d.ts.map +1 -0
- package/dist/utils/formatDate.d.ts +34 -0
- package/dist/utils/formatDate.d.ts.map +1 -0
- package/dist/utils/generateFlattenedUserProfile.d.ts +54 -0
- package/dist/utils/generateFlattenedUserProfile.d.ts.map +1 -0
- package/dist/utils/generatePkceStorageKey.d.ts +35 -0
- package/dist/utils/generatePkceStorageKey.d.ts.map +1 -0
- package/dist/utils/generateStateParamForRequestCorrelation.d.ts +35 -0
- package/dist/utils/generateStateParamForRequestCorrelation.d.ts.map +1 -0
- package/dist/utils/generateUserProfile.d.ts +56 -0
- package/dist/utils/generateUserProfile.d.ts.map +1 -0
- package/dist/utils/get.d.ts +30 -0
- package/dist/utils/get.d.ts.map +1 -0
- package/dist/utils/getAuthorizeRequestUrlParams.d.ts +61 -0
- package/dist/utils/getAuthorizeRequestUrlParams.d.ts.map +1 -0
- package/dist/utils/getLatestStateParam.d.ts +41 -0
- package/dist/utils/getLatestStateParam.d.ts.map +1 -0
- package/dist/utils/getRedirectBasedSignUpUrl.d.ts +30 -0
- package/dist/utils/getRedirectBasedSignUpUrl.d.ts.map +1 -0
- package/dist/utils/identifyPlatform.d.ts +31 -0
- package/dist/utils/identifyPlatform.d.ts.map +1 -0
- package/dist/utils/isEmpty.d.ts +49 -0
- package/dist/utils/isEmpty.d.ts.map +1 -0
- package/dist/utils/isRecognizedBaseUrlPattern.d.ts +33 -0
- package/dist/utils/isRecognizedBaseUrlPattern.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +143 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/parseApiErrorMessage.d.ts +29 -0
- package/dist/utils/parseApiErrorMessage.d.ts.map +1 -0
- package/dist/utils/processOpenIDScopes.d.ts +42 -0
- package/dist/utils/processOpenIDScopes.d.ts.map +1 -0
- package/dist/utils/processUsername.d.ts +74 -0
- package/dist/utils/processUsername.d.ts.map +1 -0
- package/dist/utils/removeTrailingSlash.d.ts +32 -0
- package/dist/utils/removeTrailingSlash.d.ts.map +1 -0
- package/dist/utils/resolveFieldName.d.ts +20 -0
- package/dist/utils/resolveFieldName.d.ts.map +1 -0
- package/dist/utils/resolveFieldType.d.ts +21 -0
- package/dist/utils/resolveFieldType.d.ts.map +1 -0
- package/dist/utils/set.d.ts +31 -0
- package/dist/utils/set.d.ts.map +1 -0
- package/dist/utils/transformBrandingPreferenceToTheme.d.ts +49 -0
- package/dist/utils/transformBrandingPreferenceToTheme.d.ts.map +1 -0
- package/dist/utils/v2/containsMetaFlowTemplateLiteral.d.ts +57 -0
- package/dist/utils/v2/containsMetaFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/countryCodeToFlagEmoji.d.ts +26 -0
- package/dist/utils/v2/countryCodeToFlagEmoji.d.ts.map +1 -0
- package/dist/utils/v2/extractEmojiFromUri.d.ts +32 -0
- package/dist/utils/v2/extractEmojiFromUri.d.ts.map +1 -0
- package/dist/utils/v2/isEmojiUri.d.ts +34 -0
- package/dist/utils/v2/isEmojiUri.d.ts.map +1 -0
- package/dist/utils/v2/isMetaFlowTemplateLiteral.d.ts +45 -0
- package/dist/utils/v2/isMetaFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/isTranslationFlowTemplateLiteral.d.ts +45 -0
- package/dist/utils/v2/isTranslationFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/parseFlowTemplateLiteral.d.ts +96 -0
- package/dist/utils/v2/parseFlowTemplateLiteral.d.ts.map +1 -0
- package/dist/utils/v2/resolveFlowTemplateLiterals.d.ts +42 -0
- package/dist/utils/v2/resolveFlowTemplateLiterals.d.ts.map +1 -0
- package/dist/utils/v2/resolveLocaleDisplayName.d.ts +30 -0
- package/dist/utils/v2/resolveLocaleDisplayName.d.ts.map +1 -0
- package/dist/utils/v2/resolveLocaleEmoji.d.ts +31 -0
- package/dist/utils/v2/resolveLocaleEmoji.d.ts.map +1 -0
- package/dist/utils/v2/resolveMeta.d.ts +35 -0
- package/dist/utils/v2/resolveMeta.d.ts.map +1 -0
- package/dist/utils/withVendorCSSClassPrefix.d.ts +33 -0
- package/dist/utils/withVendorCSSClassPrefix.d.ts.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,485 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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;A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CG;IACU,aAAa,CAAC,MAAM,EAAE,0BAA0B,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,QAAQ,CAAC;IAkFlH;;;;;;;;;;;;;;;;OAgBG;IACU,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAwB1D;;;;;;;;;;;;;;;;;OAiBG;IACU,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication-helper.d.ts","sourceRoot":"","sources":["../../../src/__legacy__/helpers/authentication-helper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAA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ache 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/__legacy__/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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