@asgardeo/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.
Files changed (57) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +57 -0
  3. package/dist/AsgardeoJavaScriptClient.d.ts +81 -0
  4. package/dist/IsomorphicCrypto.d.ts +73 -0
  5. package/dist/__legacy__/client.d.ts +488 -0
  6. package/dist/__legacy__/core/authentication-core.d.ts +51 -0
  7. package/dist/__legacy__/core/index.d.ts +18 -0
  8. package/dist/__legacy__/data/data-layer.d.ts +64 -0
  9. package/dist/__legacy__/data/index.d.ts +18 -0
  10. package/dist/__legacy__/exception/exception.d.ts +23 -0
  11. package/dist/__legacy__/exception/index.d.ts +18 -0
  12. package/dist/__legacy__/helpers/authentication-helper.d.ts +37 -0
  13. package/dist/__legacy__/helpers/index.d.ts +18 -0
  14. package/dist/__legacy__/models/authorization-url.d.ts +23 -0
  15. package/dist/__legacy__/models/client-config.d.ts +60 -0
  16. package/dist/__legacy__/models/custom-grant.d.ts +26 -0
  17. package/dist/__legacy__/models/data.d.ts +27 -0
  18. package/dist/__legacy__/models/fetch.d.ts +55 -0
  19. package/dist/__legacy__/models/index.d.ts +23 -0
  20. package/dist/__legacy__/models/user.d.ts +85 -0
  21. package/dist/api/oidc/getUserInfo.d.ts +37 -0
  22. package/dist/cjs/index.js +2227 -0
  23. package/dist/cjs/index.js.map +7 -0
  24. package/dist/constants/OIDCDiscoveryConstants.d.ts +153 -0
  25. package/dist/constants/OIDCRequestConstants.d.ts +66 -0
  26. package/dist/constants/PKCEConstants.d.ts +58 -0
  27. package/dist/constants/ScopeConstants.d.ts +45 -0
  28. package/dist/constants/TokenConstants.d.ts +76 -0
  29. package/dist/constants/TokenExchangeConstants.d.ts +68 -0
  30. package/dist/errors/AsgardeoAPIError.d.ts +52 -0
  31. package/dist/errors/AsgardeoError.d.ts +49 -0
  32. package/dist/errors/AsgardeoRuntimeError.d.ts +50 -0
  33. package/dist/index.d.ts +45 -0
  34. package/dist/index.js +2186 -0
  35. package/dist/index.js.map +7 -0
  36. package/dist/models/client.d.ts +84 -0
  37. package/dist/models/config.d.ts +81 -0
  38. package/dist/models/crypto.d.ts +100 -0
  39. package/dist/models/id-token.d.ts +55 -0
  40. package/dist/models/oauth-response.d.ts +34 -0
  41. package/dist/models/oidc-discovery.d.ts +369 -0
  42. package/dist/models/oidc-endpoints.d.ts +70 -0
  43. package/dist/models/scim2-schema.d.ts +62 -0
  44. package/dist/models/store.d.ts +81 -0
  45. package/dist/models/token.d.ts +121 -0
  46. package/dist/models/user.d.ts +106 -0
  47. package/dist/models/utility-types.d.ts +20 -0
  48. package/dist/theme/createTheme.d.ts +21 -0
  49. package/dist/theme/types.d.ts +59 -0
  50. package/dist/utils/cryptoUtils.d.ts +0 -0
  51. package/dist/utils/extractPkceStorageKeyFromState.d.ts +32 -0
  52. package/dist/utils/extractTenantDomainFromIdTokenPayload.d.ts +31 -0
  53. package/dist/utils/extractUserClaimsFromIdToken.d.ts +44 -0
  54. package/dist/utils/generatePkceStorageKey.d.ts +34 -0
  55. package/dist/utils/generateStateParamForRequestCorrelation.d.ts +34 -0
  56. package/dist/utils/removeTrailingSlash.d.ts +31 -0
  57. package/package.json +61 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts", "../../src/constants/PKCEConstants.ts", "../../src/utils/extractPkceStorageKeyFromState.ts", "../../src/utils/generateStateParamForRequestCorrelation.ts", "../../src/__legacy__/exception/exception.ts", "../../src/utils/extractTenantDomainFromIdTokenPayload.ts", "../../src/utils/extractUserClaimsFromIdToken.ts", "../../src/constants/ScopeConstants.ts", "../../src/constants/OIDCDiscoveryConstants.ts", "../../src/constants/TokenExchangeConstants.ts", "../../src/__legacy__/helpers/authentication-helper.ts", "../../src/utils/generatePkceStorageKey.ts", "../../src/constants/OIDCRequestConstants.ts", "../../src/constants/TokenConstants.ts", "../../src/IsomorphicCrypto.ts", "../../src/__legacy__/core/authentication-core.ts", "../../src/__legacy__/data/data-layer.ts", "../../src/models/oauth-response.ts", "../../src/__legacy__/client.ts", "../../src/errors/AsgardeoError.ts", "../../src/errors/AsgardeoAPIError.ts", "../../src/api/oidc/getUserInfo.ts", "../../src/errors/AsgardeoRuntimeError.ts", "../../src/models/scim2-schema.ts", "../../src/AsgardeoJavaScriptClient.ts", "../../src/theme/createTheme.ts", "../../src/utils/removeTrailingSlash.ts"],
4
+ "sourcesContent": ["/**\n * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nexport * from './__legacy__/client';\nexport * from './__legacy__/models';\nexport * from './models/oauth-response';\nexport * from './IsomorphicCrypto';\nexport * from './__legacy__/exception';\nexport * from './__legacy__/data';\n\nexport {default as getUserInfo} from './api/oidc/getUserInfo';\n\nexport {default as TokenConstants} from './constants/TokenConstants';\nexport {default as OIDCRequestConstants} from './constants/OIDCRequestConstants';\n\nexport {default as AsgardeoError} from './errors/AsgardeoError';\nexport {default as AsgardeoAPIError} from './errors/AsgardeoAPIError';\nexport {default as AsgardeoRuntimeError} from './errors/AsgardeoRuntimeError';\n\nexport {AsgardeoClient, SignInOptions, SignOutOptions} from './models/client';\nexport {BaseConfig, Config, Preferences, ThemePreferences} from './models/config';\nexport {TokenResponse} from './models/token';\nexport {Crypto, JWKInterface} from './models/crypto';\nexport {IdTokenPayload} from './models/id-token';\nexport {OIDCEndpoints} from './models/oidc-endpoints';\nexport {Store} from './models/store';\nexport {User} from './models/user';\nexport {Schema, SchemaAttribute, WellKnownSchemaIds} from './models/scim2-schema';\nexport {RecursivePartial} from './models/utility-types';\n\nexport {default as AsgardeoJavaScriptClient} from './AsgardeoJavaScriptClient';\n\nexport {default as createTheme} from './theme/createTheme';\nexport {ThemeColors, ThemeConfig, Theme, ThemeMode} from './theme/types';\n\nexport {default as extractUserClaimsFromIdToken} from './utils/extractUserClaimsFromIdToken';\nexport {default as extractPkceStorageKeyFromState} from './utils/extractPkceStorageKeyFromState';\nexport {default as removeTrailingSlash} from './utils/removeTrailingSlash';\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Constants related to Proof Key for Code Exchange (PKCE) implementation.\n * This object contains all the necessary constants for implementing PKCE\n * flow in the OAuth 2.0 authorization code grant.\n *\n * @remarks\n * PKCE is an extension to the authorization code flow to prevent CSRF and\n * authorization code injection attacks. The constants are organized into\n * storage-related sections for managing PKCE state.\n *\n * @example\n * ```typescript\n * // Using storage keys\n * const codeVerifierKey = PKCEConstants.Storage.StorageKeys.CODE_VERIFIER;\n * const separator = PKCEConstants.Storage.StorageKeys.SEPARATOR;\n * ```\n */\nconst PKCEConstants = {\n /**\n * Storage-related constants for managing PKCE state\n */\n Storage: {\n /**\n * Collection of storage keys used in PKCE implementation\n */\n StorageKeys: {\n /**\n * Key used to store the PKCE code verifier in temporary storage.\n * The code verifier is a cryptographically random string that is\n * used to generate the code challenge.\n */\n CODE_VERIFIER: 'pkce_code_verifier',\n\n /**\n * Separator used in storage keys to create unique identifiers\n * by combining different parts of the key.\n */\n SEPARATOR: '#',\n },\n },\n} as const;\n\nexport default PKCEConstants;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport PKCEConstants from '../constants/PKCEConstants';\n\n/**\n * Extracts the PKCE key from a state parameter string.\n *\n * @param state - The state parameter string containing the request index.\n * @returns The PKCE key string in the format `pkce_code_verifier_${index}`.\n *\n * @example\n * ```typescript\n * const state = \"request_1\";\n * const pkceKey = extractPkceStorageKeyFromState(state);\n * // Returns: \"pkce_code_verifier_1\"\n * ```\n */\nconst extractPkceStorageKeyFromState = (state: string): string => {\n const index: number = parseInt(state.split('request_')[1]);\n\n return `${PKCEConstants.Storage.StorageKeys.CODE_VERIFIER}${PKCEConstants.Storage.StorageKeys.SEPARATOR}${index}`;\n};\n\nexport default extractPkceStorageKeyFromState;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport PKCEConstants from '../constants/PKCEConstants';\n\n/**\n * Generates a state parameter for request correlation by combining an optional state string with a request index.\n *\n * @param pkceKey - The PKCE key containing the index (format: 'pkce_code_verifier_[index]').\n * @param state - Optional state string to prepend to the request correlation.\n * @returns A state parameter string in the format '[state_]request_[index]'.\n *\n * @example\n * const pkceKey = \"pkce_code_verifier_1\";\n * const result = generateStateParamForRequestCorrelation(pkceKey, \"myState\");\n * // Returns: \"myState_request_1\"\n *\n * const resultNoState = generateStateParamForRequestCorrelation(pkceKey);\n * // Returns: \"request_1\"\n */\nconst generateStateParamForRequestCorrelation = (pkceKey: string, state?: string): string => {\n const index: number = parseInt(pkceKey.split(PKCEConstants.Storage.StorageKeys.SEPARATOR)[1]);\n\n return state ? `${state}_request_${index}` : `request_${index}`;\n};\n\nexport default generateStateParamForRequestCorrelation;\n", "/**\n * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nexport class AsgardeoAuthException {\n public name: string;\n public code: string | undefined;\n public message: string;\n\n public constructor(\n code: string,\n name: string,\n message: string\n ) {\n this.message = message;\n this.name = name;\n this.code = code;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {IdTokenPayload} from '../models/id-token';\n\n/**\n * Extracts the tenant domain from the ID token payload.\n *\n * @deprecated since v1.0.6 \u2014 This utility assumes a legacy tenant extraction pattern from the `sub` claim,\n * which may not be reliable. Will be removed in a future version.\n *\n * @param payload - The ID token payload containing the `sub` claim.\n * @param subjectSeparator - The separator used in the `sub` claim to split the user identifier and tenant domain.\n *\n * Consider extracting the tenant domain using a dedicated claim (e.g., `tenant_domain`) when available.\n */\nconst extractTenantDomainFromIdTokenPayload = (payload: IdTokenPayload, subjectSeparator: string = '@'): string => {\n const uid: string = payload.sub;\n\n if (!uid) return '';\n\n const tokens: string[] = uid.split(subjectSeparator);\n\n // This pattern assumes a format like: `<username>@<something>@<tenant_domain>`\n return tokens.length > 2 ? tokens[tokens.length - 1] : '';\n};\n\nexport default extractTenantDomainFromIdTokenPayload;\n", "/**\n * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {IdTokenPayload} from '../models/id-token';\n\n/**\n * Removes standard protocol-specific claims from the ID token payload\n * and returns a camelCased object of user-specific claims.\n *\n * @param payload The raw ID token payload.\n * @returns A cleaned-up, camelCased object containing only user-specific claims.\n * \n * @example\n * ````typescript\n * const idTokenPayload = {\n * iss: 'https://example.com',\n * aud: 'client_id',\n * exp: 1712345678,\n * iat: 1712345670,\n * email: 'user@example.com'\n * };\n * \n * const userClaims = extractUserClaimsFromIdToken(idTokenPayload);\n * // // userClaims will be:\n * // {\n * // email: 'user@example.com'\n * // }\n * ```\n */\nconst extractUserClaimsFromIdToken = (payload: IdTokenPayload): Record<string, unknown> => {\n const filteredPayload: Partial<IdTokenPayload> = {...payload};\n\n const protocolClaims = [\n 'iss',\n 'aud',\n 'exp',\n 'iat',\n 'acr',\n 'amr',\n 'azp',\n 'auth_time',\n 'nonce',\n 'c_hash',\n 'at_hash',\n 'nbf',\n 'isk',\n 'sid',\n 'jti',\n 'sub',\n ];\n\n protocolClaims.forEach(claim => {\n delete filteredPayload[claim as keyof IdTokenPayload];\n });\n\n const userClaims: Record<string, unknown> = {};\n\n Object.entries(filteredPayload).forEach(([key, value]) => {\n const camelCasedKey = key\n .split('_')\n .map((part, i) => (i === 0 ? part : part[0].toUpperCase() + part.slice(1)))\n .join('');\n\n userClaims[camelCasedKey] = value;\n });\n\n return userClaims;\n};\n\nexport default extractUserClaimsFromIdToken;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Constants for OAuth 2.0 and OpenID Connect scopes.\n * These scopes define the level of access that the client application\n * is requesting from the authorization server.\n *\n * @remarks\n * Scopes are space-separated strings that represent different permissions.\n * The 'openid' scope is required for OpenID Connect flows, while other\n * scopes provide access to different resources or user information.\n *\n * @example\n * ```typescript\n * // Requesting OpenID Connect authentication\n * const scope = [ScopeConstants.OPENID];\n * \n * // Requesting profile information\n * const scopes = [ScopeConstants.OPENID, ScopeConstants.PROFILE];\n * ```\n */\nconst ScopeConstants = {\n /**\n * The base OpenID Connect scope.\n * Required for all OpenID Connect flows. Indicates that the client\n * is initiating an OpenID Connect authentication request.\n */\n OPENID: 'openid',\n} as const;\n\nexport default ScopeConstants;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Constants related to OpenID Connect (OIDC) metadata and endpoints.\n * This object contains all the standard OIDC endpoints and storage keys\n * used throughout the application for authentication and authorization.\n *\n * @remarks\n * The constants are organized into two main sections:\n * 1. Endpoints - Contains all OIDC standard endpoint paths\n * 2. Storage - Contains keys used for storing OIDC-related data\n *\n * @example\n * ```typescript\n * // Using an endpoint\n * const authEndpoint = OIDCDiscoveryConstants.Endpoints.AUTHORIZATION;\n *\n * // Using a storage key\n * const tokenKey = OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.TOKEN;\n * ```\n */\nconst OIDCDiscoveryConstants = {\n /**\n * Collection of standard OIDC endpoint paths used for authentication flows.\n * These endpoints are relative paths that should be appended to the base URL\n * of your identity provider.\n */\n\n Endpoints: {\n /**\n * Authorization endpoint for initiating the OAuth2/OIDC flow.\n * This endpoint is used to request authorization and receive an authorization code.\n */\n AUTHORIZATION: '/oauth2/authorize',\n\n /**\n * Session check iframe endpoint for session management.\n * Used to monitor the user's session state through a hidden iframe.\n */\n SESSION_IFRAME: '/oidc/checksession',\n\n /**\n * End session endpoint for logout functionality.\n * Used to terminate the user's session and perform logout operations.\n */\n END_SESSION: '/oidc/logout',\n\n /**\n * Token issuer endpoint.\n * The endpoint that issues OAuth2/OIDC tokens.\n */\n ISSUER: '/oauth2/token',\n\n /**\n * JSON Web Key Set endpoint for key validation.\n * Provides the public keys used to verify token signatures.\n */\n JWKS: '/oauth2/jwks',\n\n /**\n * Token revocation endpoint.\n * Used to invalidate access or refresh tokens before they expire.\n */\n REVOCATION: '/oauth2/revoke',\n\n /**\n * Token endpoint for obtaining access tokens.\n * Used to exchange authorization codes for access tokens and refresh tokens.\n */\n TOKEN: '/oauth2/token',\n\n /**\n * UserInfo endpoint for obtaining user claims.\n * Provides authenticated user information when called with a valid access token.\n */\n USERINFO: '/oauth2/userinfo',\n },\n\n /**\n * Storage related constants used for maintaining OIDC state.\n * These constants define the keys used to store OIDC-related data\n * in the browser's storage mechanisms.\n */\n\n Storage: {\n /**\n * Storage keys for various OIDC endpoints and configurations.\n * These keys are used to store endpoint URLs and configuration\n * states in the browser's storage.\n */\n\n StorageKeys: {\n /**\n * Collection of storage keys for OIDC endpoints.\n * These keys are used to store the discovered endpoint URLs\n * from the OpenID Provider's configuration.\n */\n\n Endpoints: {\n /**\n * Storage key for the authorization endpoint URL.\n * Used to store the URL where authorization requests should be sent.\n */\n AUTHORIZATION: 'authorization_endpoint',\n\n /**\n * Storage key for the token endpoint URL.\n * Used to store the URL where token requests should be sent.\n */\n TOKEN: 'token_endpoint',\n\n /**\n * Storage key for the revocation endpoint URL.\n * Used to store the URL where token revocation requests should be sent.\n */\n REVOCATION: 'revocation_endpoint',\n\n /**\n * Storage key for the end session endpoint URL.\n * Used to store the URL where logout requests should be sent.\n */\n END_SESSION: 'end_session_endpoint',\n\n /**\n * Storage key for the JWKS URI endpoint URL.\n * Used to store the URL where JSON Web Key Sets can be retrieved.\n */\n JWKS: 'jwks_uri',\n\n /**\n * Storage key for the session check iframe URL.\n * Used to store the URL of the iframe used for session state monitoring.\n */\n SESSION_IFRAME: 'check_session_iframe',\n\n /**\n * Storage key for the issuer identifier URL.\n * Used to store the URL that identifies the OpenID Provider.\n */\n ISSUER: 'issuer',\n\n /**\n * Storage key for the userinfo endpoint URL.\n * Used to store the URL where user information can be retrieved.\n */\n USERINFO: 'userinfo_endpoint',\n },\n\n /**\n * Flag to track if OpenID Provider configuration is initiated.\n * Used to determine if the OIDC discovery process has been started.\n * This helps prevent duplicate initialization attempts.\n */\n OPENID_PROVIDER_CONFIG_INITIATED: 'op_config_initiated',\n },\n },\n} as const;\n\nexport default OIDCDiscoveryConstants;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Constants for OAuth 2.0 Token Exchange operations.\n * This object contains placeholders used in token exchange requests\n * and responses for dynamic value substitution.\n *\n * @remarks\n * These placeholders are used in token exchange templates and are replaced\n * with actual values during request processing. They help in creating\n * flexible and reusable token exchange configurations.\n *\n * @example\n * ```typescript\n * // Using placeholders in a token exchange template\n * const template = `grant_type=urn:ietf:params:oauth:grant-type:token-exchange&subject_token=${TokenExchangeConstants.Placeholders.TOKEN}`;\n * ```\n */\nconst TokenExchangeConstants = {\n /**\n * Collection of placeholder strings used in token exchange operations.\n * These placeholders are replaced with actual values when processing\n * token exchange requests.\n */\n Placeholders: {\n /**\n * Placeholder for the token value in exchange requests.\n * Usually replaced with an access token or refresh token.\n */\n TOKEN: '{{token}}',\n\n /**\n * Placeholder for the username in token exchange operations.\n * Used when user identity needs to be included in the exchange.\n */\n USERNAME: '{{username}}',\n\n /**\n * Placeholder for OAuth scopes in token exchange requests.\n * Replaced with space-separated scope strings.\n */\n SCOPE: '{{scope}}',\n\n /**\n * Placeholder for client ID in token exchange operations.\n * Required for client authentication.\n */\n CLIENT_ID: '{{clientID}}',\n\n /**\n * Placeholder for client secret in token exchange operations.\n * Used for client authentication in confidential client flows.\n */\n CLIENT_SECRET: '{{clientSecret}}',\n },\n} as const;\n\nexport default TokenExchangeConstants;\n", "/**\n * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {IsomorphicCrypto} from '../../IsomorphicCrypto';\nimport {DataLayer} from '../data';\nimport {AsgardeoAuthException} from '../exception';\nimport {AuthClientConfig, AuthenticatedUserInfo, SessionData, StrictAuthClientConfig} from '../models';\nimport {JWKInterface} from '../../models/crypto';\nimport {TokenResponse, AccessTokenApiResponse} from '../../models/token';\nimport {IdTokenPayload} from '../../models/id-token';\nimport PKCEConstants from '../../constants/PKCEConstants';\nimport extractTenantDomainFromIdTokenPayload from '../../utils/extractTenantDomainFromIdTokenPayload';\nimport extractUserClaimsFromIdToken from '../../utils/extractUserClaimsFromIdToken';\nimport ScopeConstants from '../../constants/ScopeConstants';\nimport OIDCDiscoveryConstants from '../../constants/OIDCDiscoveryConstants';\nimport TokenExchangeConstants from '../../constants/TokenExchangeConstants';\nimport {OIDCDiscoveryEndpointsApiResponse, OIDCDiscoveryApiResponse} from '../../models/oidc-discovery';\n\nexport class AuthenticationHelper<T> {\n private _dataLayer: DataLayer<T>;\n private _config: () => Promise<AuthClientConfig>;\n private _oidcProviderMetaData: () => Promise<OIDCDiscoveryApiResponse>;\n private _cryptoHelper: IsomorphicCrypto;\n\n public constructor(dataLayer: DataLayer<T>, cryptoHelper: IsomorphicCrypto) {\n this._dataLayer = dataLayer;\n this._config = async () => await this._dataLayer.getConfigData();\n this._oidcProviderMetaData = async () => await this._dataLayer.getOIDCProviderMetaData();\n this._cryptoHelper = cryptoHelper;\n }\n\n public async resolveEndpoints(response: OIDCDiscoveryApiResponse): Promise<OIDCDiscoveryApiResponse> {\n const oidcProviderMetaData: OIDCDiscoveryApiResponse = {};\n const configData: StrictAuthClientConfig = await this._config();\n\n configData.endpoints &&\n Object.keys(configData.endpoints).forEach((endpointName: string) => {\n const snakeCasedName: string = endpointName.replace(/[A-Z]/g, (letter: string) => `_${letter.toLowerCase()}`);\n\n oidcProviderMetaData[snakeCasedName] = configData?.endpoints ? configData.endpoints[endpointName] : '';\n });\n\n return {...response, ...oidcProviderMetaData};\n }\n\n public async resolveEndpointsExplicitly(): Promise<OIDCDiscoveryEndpointsApiResponse> {\n const oidcProviderMetaData: OIDCDiscoveryApiResponse = {};\n const configData: StrictAuthClientConfig = await this._config();\n\n const requiredEndpoints: string[] = [\n OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.AUTHORIZATION,\n OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.END_SESSION,\n OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.JWKS,\n OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.SESSION_IFRAME,\n OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.REVOCATION,\n OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.TOKEN,\n OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.ISSUER,\n OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.USERINFO,\n ];\n\n const isRequiredEndpointsContains: boolean = configData.endpoints\n ? requiredEndpoints.every((reqEndpointName: string) => {\n return configData.endpoints\n ? Object.keys(configData.endpoints).some((endpointName: string) => {\n const snakeCasedName: string = endpointName.replace(\n /[A-Z]/g,\n (letter: string) => `_${letter.toLowerCase()}`,\n );\n\n return snakeCasedName === reqEndpointName;\n })\n : false;\n })\n : false;\n\n if (!isRequiredEndpointsContains) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_HELPER-REE-NF01',\n 'Required endpoints missing',\n 'Some or all of the required endpoints are missing in the object passed to the `endpoints` ' +\n 'attribute of the`AuthConfig` object.',\n );\n }\n\n configData.endpoints &&\n Object.keys(configData.endpoints).forEach((endpointName: string) => {\n const snakeCasedName: string = endpointName.replace(/[A-Z]/g, (letter: string) => `_${letter.toLowerCase()}`);\n\n oidcProviderMetaData[snakeCasedName] = configData?.endpoints ? configData.endpoints[endpointName] : '';\n });\n\n return {...oidcProviderMetaData};\n }\n\n public async resolveEndpointsByBaseURL(): Promise<OIDCDiscoveryEndpointsApiResponse> {\n const oidcProviderMetaData: OIDCDiscoveryEndpointsApiResponse = {};\n const configData: StrictAuthClientConfig = await this._config();\n\n const baseUrl: string = (configData as any).baseUrl;\n\n if (!baseUrl) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_HELPER_REBO-NF01',\n 'Base URL not defined.',\n 'Base URL is not defined in AuthClient config.',\n );\n }\n\n configData.endpoints &&\n Object.keys(configData.endpoints).forEach((endpointName: string) => {\n const snakeCasedName: string = endpointName.replace(/[A-Z]/g, (letter: string) => `_${letter.toLowerCase()}`);\n\n oidcProviderMetaData[snakeCasedName] = configData?.endpoints ? configData.endpoints[endpointName] : '';\n });\n\n const defaultEndpoints: OIDCDiscoveryApiResponse = {\n [OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints\n .AUTHORIZATION]: `${baseUrl}${OIDCDiscoveryConstants.Endpoints.AUTHORIZATION}`,\n [OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints\n .END_SESSION]: `${baseUrl}${OIDCDiscoveryConstants.Endpoints.END_SESSION}`,\n [OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints\n .ISSUER]: `${baseUrl}${OIDCDiscoveryConstants.Endpoints.ISSUER}`,\n [OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.JWKS]: `${baseUrl}${OIDCDiscoveryConstants.Endpoints.JWKS}`,\n [OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints\n .SESSION_IFRAME]: `${baseUrl}${OIDCDiscoveryConstants.Endpoints.SESSION_IFRAME}`,\n [OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints\n .REVOCATION]: `${baseUrl}${OIDCDiscoveryConstants.Endpoints.REVOCATION}`,\n [OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints\n .TOKEN]: `${baseUrl}${OIDCDiscoveryConstants.Endpoints.TOKEN}`,\n [OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints\n .USERINFO]: `${baseUrl}${OIDCDiscoveryConstants.Endpoints.USERINFO}`,\n };\n\n return {...defaultEndpoints, ...oidcProviderMetaData};\n }\n\n public async validateIdToken(idToken: string): Promise<boolean> {\n const jwksEndpoint: string | undefined = (await this._dataLayer.getOIDCProviderMetaData()).jwks_uri;\n const configData: StrictAuthClientConfig = await this._config();\n\n if (!jwksEndpoint || jwksEndpoint.trim().length === 0) {\n throw new AsgardeoAuthException(\n 'JS_AUTH_HELPER-VIT-NF01',\n 'JWKS endpoint not found.',\n 'No JWKS endpoint was found in the OIDC provider meta data returned by the well-known endpoint ' +\n 'or the JWKS endpoint passed to the SDK is empty.',\n );\n }\n\n let response: Response;\n\n try {\n response = await fetch(jwksEndpoint, {\n credentials: configData.sendCookiesInRequests ? 'include' : 'same-origin',\n });\n } catch (error: any) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_HELPER-VIT-NE02',\n 'Request to jwks endpoint failed.',\n error ?? 'The request sent to get the jwks from the server failed.',\n );\n }\n\n if (response.status !== 200 || !response.ok) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_HELPER-VIT-HE03',\n `Invalid response status received for jwks request (${response.statusText}).`,\n (await response.json()) as string,\n );\n }\n\n const issuer: string | undefined = (await this._oidcProviderMetaData()).issuer;\n\n const {keys}: {keys: JWKInterface[]} = (await response.json()) as {\n keys: JWKInterface[];\n };\n\n const jwk: any = await this._cryptoHelper.getJWKForTheIdToken(idToken.split('.')[0], keys);\n\n return this._cryptoHelper.isValidIdToken(\n idToken,\n jwk,\n (await this._config()).clientID,\n issuer ?? '',\n this._cryptoHelper.decodeIDToken(idToken).sub,\n (await this._config()).clockTolerance,\n (await this._config()).validateIDTokenIssuer ?? true,\n );\n }\n\n public getAuthenticatedUserInfo(idToken: string): AuthenticatedUserInfo {\n const payload: IdTokenPayload = this._cryptoHelper.decodeIDToken(idToken);\n const tenantDomain: string = extractTenantDomainFromIdTokenPayload(payload);\n const username: string = payload?.['username'] ?? '';\n const givenName: string = payload?.['given_name'] ?? '';\n const familyName: string = payload?.['family_name'] ?? '';\n const fullName: string =\n givenName && familyName ? `${givenName} ${familyName}` : givenName ? givenName : familyName ? familyName : '';\n const displayName: string = payload.preferred_username ?? fullName;\n\n return {\n displayName: displayName,\n tenantDomain,\n username: username,\n ...extractUserClaimsFromIdToken(payload),\n };\n }\n\n public async replaceCustomGrantTemplateTags(text: string, userID?: string): Promise<string> {\n let scope: string = ScopeConstants.OPENID;\n const configData: StrictAuthClientConfig = await this._config();\n const sessionData: SessionData = await this._dataLayer.getSessionData(userID);\n\n if (configData.scope && configData.scope.length > 0) {\n if (!configData.scope.includes(ScopeConstants.OPENID)) {\n configData.scope.push(ScopeConstants.OPENID);\n }\n scope = configData.scope.join(' ');\n }\n\n return text\n .replace(TokenExchangeConstants.Placeholders.TOKEN, sessionData.access_token)\n .replace(\n TokenExchangeConstants.Placeholders.USERNAME,\n this.getAuthenticatedUserInfo(sessionData.id_token).username,\n )\n .replace(TokenExchangeConstants.Placeholders.SCOPE, scope)\n .replace(TokenExchangeConstants.Placeholders.CLIENT_ID, configData.clientID)\n .replace(TokenExchangeConstants.Placeholders.CLIENT_SECRET, configData.clientSecret ?? '');\n }\n\n public async clearUserSessionData(userID?: string): Promise<void> {\n await this._dataLayer.removeTemporaryData(userID);\n await this._dataLayer.removeSessionData(userID);\n }\n\n public async handleTokenResponse(response: Response, userID?: string): Promise<TokenResponse> {\n if (response.status !== 200 || !response.ok) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_HELPER-HTR-NE01',\n `Invalid response status received for token request (${response.statusText}).`,\n (await response.json()) as string,\n );\n }\n\n //Get the response in JSON\n const parsedResponse: AccessTokenApiResponse = (await response.json()) as AccessTokenApiResponse;\n\n parsedResponse.created_at = new Date().getTime();\n\n const shouldValidateIdToken: boolean | undefined = (await this._config()).validateIDToken;\n\n if (shouldValidateIdToken) {\n return this.validateIdToken(parsedResponse.id_token).then(async () => {\n await this._dataLayer.setSessionData(parsedResponse, userID);\n\n const tokenResponse: TokenResponse = {\n accessToken: parsedResponse.access_token,\n createdAt: parsedResponse.created_at,\n expiresIn: parsedResponse.expires_in,\n idToken: parsedResponse.id_token,\n refreshToken: parsedResponse.refresh_token,\n scope: parsedResponse.scope,\n tokenType: parsedResponse.token_type,\n };\n\n return Promise.resolve(tokenResponse);\n });\n } else {\n const tokenResponse: TokenResponse = {\n accessToken: parsedResponse.access_token,\n createdAt: parsedResponse.created_at,\n expiresIn: parsedResponse.expires_in,\n idToken: parsedResponse.id_token,\n refreshToken: parsedResponse.refresh_token,\n scope: parsedResponse.scope,\n tokenType: parsedResponse.token_type,\n };\n\n await this._dataLayer.setSessionData(parsedResponse, userID);\n\n return Promise.resolve(tokenResponse);\n }\n }\n}\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport PKCEConstants from '../constants/PKCEConstants';\nimport {TemporaryStore} from '../models/store';\n\n/**\n * Generates the next available PKCE storage key based on the current temporary data.\n *\n * The generated key will follow the format: `pkce_code_verifier_<index>`, where `<index>` is incremented\n * based on the highest existing index in the provided storage object.\n *\n * @param tempStore - The object that holds temporary PKCE-related data (e.g., sessionStorage).\n *\n * @returns A new unique PKCE storage key to store the next `code_verifier`.\n *\n * @example\n * const key = generatePkceStorageKey(sessionStorage);\n * // Returns: \"pkce_code_verifier_3\" (if existing keys are pkce_code_verifier_0 to _2)\n */\nconst generatePkceStorageKey = (tempStore: TemporaryStore): string => {\n const keys: string[] = [];\n\n Object.keys(tempStore).forEach((key: string) => {\n if (key.startsWith(PKCEConstants.Storage.StorageKeys.CODE_VERIFIER)) {\n keys.push(key);\n }\n });\n\n const lastKey: string | undefined = keys.sort().pop();\n const index: number = parseInt(lastKey?.split(PKCEConstants.Storage.StorageKeys.SEPARATOR)[1] ?? '-1');\n\n return `${PKCEConstants.Storage.StorageKeys.CODE_VERIFIER}${PKCEConstants.Storage.StorageKeys.SEPARATOR}${index + 1}`;\n};\n\nexport default generatePkceStorageKey;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Constants representing standard OpenID Connect (OIDC) request and response parameters.\n * These parameters are commonly used during authorization, token exchange, and logout flows.\n */\nconst OIDCRequestConstants = {\n Params: {\n /**\n * The authorization code returned from the authorization endpoint.\n * Used in the authorization code flow.\n */\n AUTHORIZATION_CODE: 'code',\n\n /**\n * Session state parameter used for session management between the client and the OP.\n */\n SESSION_STATE: 'session_state',\n\n /**\n * State parameter used to maintain state between the request and the callback.\n * Helps in preventing CSRF attacks.\n */\n STATE: 'state',\n\n /**\n * Indicates whether sign-out was successful during the end-session flow.\n * May be returned by the OP after a logout request.\n */\n SIGN_OUT_SUCCESS: 'sign_out_success',\n },\n \n /**\n * Sign-out related constants for managing the end-session flow in OIDC.\n */\n SignOut: {\n /**\n * Storage-related constants for managing sign-out state.\n */\n Storage: {\n /**\n * Collection of storage keys used in sign-out implementation\n */\n StorageKeys: {\n /**\n * Storage key for the sign-out URL.\n * Used to store the complete URL where the user should be redirected after\n * completing the OIDC logout process.\n */\n SIGN_OUT_URL: 'sign_out_url',\n },\n },\n },\n} as const;\n\nexport default OIDCRequestConstants;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Constants related to OIDC token management and storage.\n * This object contains configuration values and storage keys\n * used in token validation and management processes.\n *\n * @remarks\n * The constants are organized into two main sections:\n * 1. SignatureValidation - Contains supported algorithms for token validation\n * 2. Storage - Contains keys used for storing token-related data\n *\n * @example\n * ```typescript\n * // Using signature validation algorithms\n * const algorithms = TokenConstants.SignatureValidation.SUPPORTED_ALGORITHMS;\n *\n * // Using storage keys\n * const timerKey = TokenConstants.Storage.StorageKeys.REFRESH_TOKEN_TIMER;\n * ```\n */\nconst TokenConstants = {\n /**\n * Token signature validation constants.\n * Contains configurations related to token signature verification.\n */\n SignatureValidation: {\n /**\n * Fallback array of supported signature algorithms for OIDC token validation.\n * These values are used when the supported algorithms cannot be retrieved from\n * the .well-known/openid-configuration endpoint.\n *\n * Supported algorithms:\n * - `RS256` - RSASSA-PKCS1-v1_5 using SHA-256\n * - `RS512` - RSASSA-PKCS1-v1_5 using SHA-512\n * - `RS384` - RSASSA-PKCS1-v1_5 using SHA-384\n * - `PS256` - RSASSA-PSS using SHA-256 and MGF1 with SHA-256\n */\n SUPPORTED_ALGORITHMS: ['RS256', 'RS512', 'RS384', 'PS256'],\n },\n\n /**\n * Storage-related constants for OIDC tokens.\n * Contains keys used to store token-related data in browser storage.\n */\n Storage: {\n /**\n * Collection of storage keys used in token management.\n * These keys are used to store and retrieve token-related\n * information from browser storage.\n */\n StorageKeys: {\n /**\n * Key used to store the refresh token timer identifier.\n * This timer is used to schedule token refresh operations\n * before the current token expires.\n */\n REFRESH_TOKEN_TIMER: 'refresh_token_timer',\n },\n },\n} as const;\n\nexport default TokenConstants;\n", "/**\n * Copyright (c) 2022, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AsgardeoAuthException} from './__legacy__/exception';\nimport {Crypto, JWKInterface} from './models/crypto';\nimport {IdTokenPayload} from './models/id-token';\nimport TokenConstants from './constants/TokenConstants';\n\nexport class IsomorphicCrypto<T = any> {\n private _cryptoUtils: Crypto<T>;\n\n public constructor(cryptoUtils: Crypto<T>) {\n this._cryptoUtils = cryptoUtils;\n }\n\n /**\n * Generate code verifier.\n *\n * @returns code verifier.\n */\n public getCodeVerifier(): string {\n return this._cryptoUtils.base64URLEncode(this._cryptoUtils.generateRandomBytes(32));\n }\n\n /**\n * Derive code challenge from the code verifier.\n *\n * @param verifier - Code verifier.\n *\n * @returns - code challenge.\n */\n public getCodeChallenge(verifier: string): string {\n return this._cryptoUtils.base64URLEncode(this._cryptoUtils.hashSha256(verifier));\n }\n\n /**\n * Get JWK used for the id_token\n *\n * @param jwtHeader - header of the id_token.\n * @param keys - jwks response.\n *\n * @returns public key.\n *\n * @throws\n */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n public getJWKForTheIdToken(jwtHeader: string, keys: JWKInterface[]): JWKInterface {\n const headerJSON: Record<string, string> = JSON.parse(this._cryptoUtils.base64URLDecode(jwtHeader));\n\n for (const key of keys) {\n if (headerJSON['kid'] === key.kid) {\n return key;\n }\n }\n\n throw new AsgardeoAuthException(\n 'JS-CRYPTO_UTIL-GJFTIT-IV01',\n 'kid not found.',\n \"Failed to find the 'kid' specified in the id_token. 'kid' found in the header : \" +\n headerJSON['kid'] +\n ', Expected values: ' +\n keys.map((key: JWKInterface) => key.kid).join(', '),\n );\n }\n\n /**\n * Verify id token.\n *\n * @param idToken - id_token received from the IdP.\n * @param jwk - public key used for signing.\n * @param clientID - app identification.\n * @param issuer - id_token issuer.\n * @param username - Username.\n * @param clockTolerance - Allowed leeway for id_tokens (in seconds).\n *\n * @returns whether the id_token is valid.\n *\n * @throws\n */\n public isValidIdToken(\n idToken: string,\n jwk: JWKInterface,\n clientID: string,\n issuer: string,\n username: string,\n clockTolerance: number | undefined,\n validateJwtIssuer: boolean | undefined,\n ): Promise<boolean> {\n return this._cryptoUtils\n .verifyJwt(\n idToken,\n jwk,\n TokenConstants.SignatureValidation.SUPPORTED_ALGORITHMS as unknown as string[],\n clientID,\n issuer,\n username,\n clockTolerance,\n validateJwtIssuer,\n )\n .then((response: boolean) => {\n if (response) {\n return Promise.resolve(true);\n }\n\n return Promise.reject(\n new AsgardeoAuthException(\n 'JS-CRYPTO_HELPER-IVIT-IV01',\n 'Invalid ID token.',\n 'ID token validation returned false',\n ),\n );\n });\n }\n\n /**\n * This function decodes the payload of an id token and returns it.\n *\n * @param idToken - The id token to be decoded.\n *\n * @returns - The decoded payload of the id token.\n *\n * @throws\n */\n public decodeIDToken(idToken: string): IdTokenPayload {\n try {\n const utf8String: string = this._cryptoUtils.base64URLDecode(idToken.split('.')[1]);\n const payload: IdTokenPayload = JSON.parse(utf8String);\n\n return payload;\n } catch (error: any) {\n throw new AsgardeoAuthException('JS-CRYPTO_UTIL-DIT-IV01', 'Decoding ID token failed.', error);\n }\n }\n}\n", "/**\n * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\nimport extractPkceStorageKeyFromState from '../../utils/extractPkceStorageKeyFromState';\nimport generateStateParamForRequestCorrelation from '../../utils/generateStateParamForRequestCorrelation';\nimport {DataLayer} from '../data';\nimport {AsgardeoAuthException} from '../exception';\nimport {AuthenticationHelper} from '../helpers';\nimport {\n AuthClientConfig,\n AuthenticatedUserInfo,\n AuthorizationURLParams,\n BasicUserInfo,\n CustomGrantConfig,\n FetchRequestConfig,\n FetchResponse,\n SessionData,\n StrictAuthClientConfig,\n} from '../models';\nimport {TokenResponse} from '../../models/token';\nimport {Crypto} from '../../models/crypto';\nimport {IdTokenPayload} from '../../models/id-token';\nimport {TemporaryStore} from '../../models/store';\nimport {OIDCEndpoints} from '../../models/oidc-endpoints';\nimport generatePkceStorageKey from '../../utils/generatePkceStorageKey';\nimport ScopeConstants from '../../constants/ScopeConstants';\nimport OIDCDiscoveryConstants from '../../constants/OIDCDiscoveryConstants';\nimport OIDCRequestConstants from '../../constants/OIDCRequestConstants';\nimport {OIDCDiscoveryApiResponse} from '../../models/oidc-discovery';\nimport { IsomorphicCrypto } from '../../IsomorphicCrypto';\n\nexport class AuthenticationCore<T> {\n private _dataLayer: DataLayer<T>;\n private _config: () => Promise<AuthClientConfig>;\n private _oidcProviderMetaData: () => Promise<OIDCDiscoveryApiResponse>;\n private _authenticationHelper: AuthenticationHelper<T>;\n private _cryptoUtils: Crypto;\n private _cryptoHelper: IsomorphicCrypto;\n\n public constructor(dataLayer: DataLayer<T>, cryptoUtils: Crypto) {\n this._cryptoUtils = cryptoUtils;\n this._cryptoHelper = new IsomorphicCrypto(cryptoUtils);\n this._authenticationHelper = new AuthenticationHelper(dataLayer, this._cryptoHelper);\n this._dataLayer = dataLayer;\n this._config = async () => await this._dataLayer.getConfigData();\n this._oidcProviderMetaData = async () => await this._dataLayer.getOIDCProviderMetaData();\n }\n\n public async getAuthorizationURLParams(\n config?: AuthorizationURLParams,\n userID?: string,\n ): Promise<Map<string, string>> {\n const configData: StrictAuthClientConfig = await this._config();\n\n const authorizeRequestParams: Map<string, string> = new Map<string, string>();\n\n authorizeRequestParams.set('response_type', 'code');\n authorizeRequestParams.set('client_id', configData.clientID);\n\n let scope: string = ScopeConstants.OPENID;\n\n if (configData.scope && configData.scope.length > 0) {\n if (!configData.scope.includes(ScopeConstants.OPENID)) {\n configData.scope.push(ScopeConstants.OPENID);\n }\n scope = configData.scope.join(' ');\n }\n\n authorizeRequestParams.set('scope', scope);\n authorizeRequestParams.set('redirect_uri', configData.signInRedirectURL);\n\n if (configData.responseMode) {\n authorizeRequestParams.set('response_mode', configData.responseMode);\n }\n\n const tempStore: TemporaryStore = await this._dataLayer.getTemporaryData(userID);\n const pkceKey: string = await generatePkceStorageKey(tempStore);\n\n if (configData.enablePKCE) {\n const codeVerifier: string = this._cryptoHelper?.getCodeVerifier();\n const codeChallenge: string = this._cryptoHelper?.getCodeChallenge(codeVerifier);\n\n await this._dataLayer.setTemporaryDataParameter(pkceKey, codeVerifier, userID);\n authorizeRequestParams.set('code_challenge_method', 'S256');\n authorizeRequestParams.set('code_challenge', codeChallenge);\n }\n\n if (configData.prompt) {\n authorizeRequestParams.set('prompt', configData.prompt);\n }\n\n const customParams: AuthorizationURLParams | undefined = config;\n\n if (customParams) {\n for (const [key, value] of Object.entries(customParams)) {\n if (key != '' && value != '' && key !== OIDCRequestConstants.Params.STATE) {\n authorizeRequestParams.set(key, value.toString());\n }\n }\n }\n\n authorizeRequestParams.set(\n OIDCRequestConstants.Params.STATE,\n generateStateParamForRequestCorrelation(\n pkceKey,\n customParams ? customParams[OIDCRequestConstants.Params.STATE]?.toString() : '',\n ),\n );\n\n return authorizeRequestParams;\n }\n\n public async getAuthorizationURL(config?: AuthorizationURLParams, userID?: string): Promise<string> {\n const authorizeEndpoint: string = (await this._dataLayer.getOIDCProviderMetaDataParameter(\n OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.AUTHORIZATION as keyof OIDCDiscoveryApiResponse,\n )) as string;\n\n if (!authorizeEndpoint || authorizeEndpoint.trim().length === 0) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-GAU-NF01',\n 'No authorization endpoint found.',\n 'No authorization endpoint was found in the OIDC provider meta data from the well-known endpoint ' +\n 'or the authorization endpoint passed to the SDK is empty.',\n );\n }\n\n const authorizeRequest: URL = new URL(authorizeEndpoint);\n\n const authorizeRequestParams: Map<string, string> = await this.getAuthorizationURLParams(config, userID);\n\n for (const [key, value] of authorizeRequestParams.entries()) {\n authorizeRequest.searchParams.append(key, value);\n }\n\n return authorizeRequest.toString();\n }\n\n public async requestAccessToken(\n authorizationCode: string,\n sessionState: string,\n state: string,\n userID?: string,\n tokenRequestConfig?: {\n params: Record<string, unknown>;\n },\n ): Promise<TokenResponse> {\n const tokenEndpoint: string | undefined = (await this._oidcProviderMetaData()).token_endpoint;\n const configData: StrictAuthClientConfig = await this._config();\n\n if (!tokenEndpoint || tokenEndpoint.trim().length === 0) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RAT1-NF01',\n 'Token endpoint not found.',\n 'No token endpoint was found in the OIDC provider meta data returned by the well-known endpoint ' +\n 'or the token endpoint passed to the SDK is empty.',\n );\n }\n\n sessionState &&\n (await this._dataLayer.setSessionDataParameter(\n OIDCRequestConstants.Params.SESSION_STATE as keyof SessionData,\n sessionState,\n userID,\n ));\n\n const body: URLSearchParams = new URLSearchParams();\n\n body.set('client_id', configData.clientID);\n\n if (configData.clientSecret && configData.clientSecret.trim().length > 0) {\n body.set('client_secret', configData.clientSecret);\n }\n\n const code: string = authorizationCode;\n\n body.set('code', code);\n\n body.set('grant_type', 'authorization_code');\n body.set('redirect_uri', configData.signInRedirectURL);\n\n if (tokenRequestConfig?.params) {\n Object.entries(tokenRequestConfig.params).forEach(([key, value]: [key: string, value: unknown]) => {\n body.append(key, value as string);\n });\n }\n\n if (configData.enablePKCE) {\n body.set(\n 'code_verifier',\n `${await this._dataLayer.getTemporaryDataParameter(extractPkceStorageKeyFromState(state), userID)}`,\n );\n\n await this._dataLayer.removeTemporaryDataParameter(extractPkceStorageKeyFromState(state), userID);\n }\n\n let tokenResponse: Response;\n\n try {\n tokenResponse = await fetch(tokenEndpoint, {\n body: body,\n credentials: configData.sendCookiesInRequests ? 'include' : 'same-origin',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n method: 'POST',\n });\n } catch (error: any) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RAT1-NE02',\n 'Requesting access token failed',\n error ?? 'The request to get the access token from the server failed.',\n );\n }\n\n if (!tokenResponse.ok) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RAT1-HE03',\n `Requesting access token failed with ${tokenResponse.statusText}`,\n (await tokenResponse.json()) as string,\n );\n }\n\n return await this._authenticationHelper.handleTokenResponse(tokenResponse, userID);\n }\n\n public async refreshAccessToken(userID?: string): Promise<TokenResponse> {\n const tokenEndpoint: string | undefined = (await this._oidcProviderMetaData()).token_endpoint;\n const configData: StrictAuthClientConfig = await this._config();\n const sessionData: SessionData = await this._dataLayer.getSessionData(userID);\n\n if (!sessionData.refresh_token) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RAT2-NF01',\n 'No refresh token found.',\n \"There was no refresh token found. Asgardeo doesn't return a \" +\n 'refresh token if the refresh token grant is not enabled.',\n );\n }\n\n if (!tokenEndpoint || tokenEndpoint.trim().length === 0) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RAT2-NF02',\n 'No refresh token endpoint found.',\n 'No refresh token endpoint was in the OIDC provider meta data returned by the well-known ' +\n 'endpoint or the refresh token endpoint passed to the SDK is empty.',\n );\n }\n\n const body: string[] = [];\n\n body.push(`client_id=${configData.clientID}`);\n body.push(`refresh_token=${sessionData.refresh_token}`);\n body.push('grant_type=refresh_token');\n\n if (configData.clientSecret && configData.clientSecret.trim().length > 0) {\n body.push(`client_secret=${configData.clientSecret}`);\n }\n\n let tokenResponse: Response;\n\n try {\n tokenResponse = await fetch(tokenEndpoint, {\n body: body.join('&'),\n credentials: configData.sendCookiesInRequests ? 'include' : 'same-origin',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n method: 'POST',\n });\n } catch (error: any) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RAT2-NR03',\n 'Refresh access token request failed.',\n error ?? 'The request to refresh the access token failed.',\n );\n }\n\n if (!tokenResponse.ok) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RAT2-HE04',\n `Refreshing access token failed with ${tokenResponse.statusText}`,\n (await tokenResponse.json()) as string,\n );\n }\n\n return this._authenticationHelper.handleTokenResponse(tokenResponse, userID);\n }\n\n public async revokeAccessToken(userID?: string): Promise<FetchResponse> {\n const revokeTokenEndpoint: string | undefined = (await this._oidcProviderMetaData()).revocation_endpoint;\n const configData: StrictAuthClientConfig = await this._config();\n\n if (!revokeTokenEndpoint || revokeTokenEndpoint.trim().length === 0) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RAT3-NF01',\n 'No revoke access token endpoint found.',\n 'No revoke access token endpoint was found in the OIDC provider meta data returned by ' +\n 'the well-known endpoint or the revoke access token endpoint passed to the SDK is empty.',\n );\n }\n\n const body: string[] = [];\n\n body.push(`client_id=${configData.clientID}`);\n body.push(`token=${(await this._dataLayer.getSessionData(userID)).access_token}`);\n body.push('token_type_hint=access_token');\n\n if (configData.clientSecret && configData.clientSecret.trim().length > 0) {\n body.push(`client_secret=${configData.clientSecret}`);\n }\n\n let response: Response;\n\n try {\n response = await fetch(revokeTokenEndpoint, {\n body: body.join('&'),\n credentials: configData.sendCookiesInRequests ? 'include' : 'same-origin',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n method: 'POST',\n });\n } catch (error: any) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RAT3-NE02',\n 'The request to revoke access token failed.',\n error ?? 'The request sent to revoke the access token failed.',\n );\n }\n\n if (response.status !== 200 || !response.ok) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RAT3-HE03',\n `Invalid response status received for revoke access token request (${response.statusText}).`,\n (await response.json()) as string,\n );\n }\n\n this._authenticationHelper.clearUserSessionData(userID);\n\n return Promise.resolve(response);\n }\n\n public async requestCustomGrant(\n customGrantParams: CustomGrantConfig,\n userID?: string,\n ): Promise<TokenResponse | FetchResponse> {\n const oidcProviderMetadata: OIDCDiscoveryApiResponse = await this._oidcProviderMetaData();\n const configData: StrictAuthClientConfig = await this._config();\n\n let tokenEndpoint: string | undefined;\n\n if (customGrantParams.tokenEndpoint && customGrantParams.tokenEndpoint.trim().length !== 0) {\n tokenEndpoint = customGrantParams.tokenEndpoint;\n } else {\n tokenEndpoint = oidcProviderMetadata.token_endpoint;\n }\n\n if (!tokenEndpoint || tokenEndpoint.trim().length === 0) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RCG-NF01',\n 'Token endpoint not found.',\n 'No token endpoint was found in the OIDC provider meta data returned by the well-known endpoint ' +\n 'or the token endpoint passed to the SDK is empty.',\n );\n }\n\n const data: string[] = await Promise.all(\n Object.entries(customGrantParams.data).map(async ([key, value]: [key: string, value: any]) => {\n const newValue: string = await this._authenticationHelper.replaceCustomGrantTemplateTags(\n value as string,\n userID,\n );\n\n return `${key}=${newValue}`;\n }),\n );\n\n let requestHeaders: Record<string, any> = {\n Accept: 'application/json',\n 'Content-Type': 'application/x-www-form-urlencoded',\n };\n\n if (customGrantParams.attachToken) {\n requestHeaders = {\n ...requestHeaders,\n Authorization: `Bearer ${(await this._dataLayer.getSessionData(userID)).access_token}`,\n };\n }\n\n const requestConfig: FetchRequestConfig = {\n body: data.join('&'),\n credentials: configData.sendCookiesInRequests ? 'include' : 'same-origin',\n headers: new Headers(requestHeaders),\n method: 'POST',\n };\n\n let response: Response;\n\n try {\n response = await fetch(tokenEndpoint, requestConfig);\n } catch (error: any) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RCG-NE02',\n 'The custom grant request failed.',\n error ?? 'The request sent to get the custom grant failed.',\n );\n }\n\n if (response.status !== 200 || !response.ok) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-RCG-HE03',\n `Invalid response status received for the custom grant request. (${response.statusText})`,\n (await response.json()) as string,\n );\n }\n\n if (customGrantParams.returnsSession) {\n return this._authenticationHelper.handleTokenResponse(response, userID);\n } else {\n return Promise.resolve((await response.json()) as TokenResponse | FetchResponse);\n }\n }\n\n public async getBasicUserInfo(userID?: string): Promise<BasicUserInfo> {\n const sessionData: SessionData = await this._dataLayer.getSessionData(userID);\n const authenticatedUser: AuthenticatedUserInfo = this._authenticationHelper.getAuthenticatedUserInfo(\n sessionData?.id_token,\n );\n\n let basicUserInfo: BasicUserInfo = {\n allowedScopes: sessionData.scope,\n sessionState: sessionData.session_state,\n };\n\n Object.keys(authenticatedUser).forEach((key: string) => {\n if (authenticatedUser[key] === undefined || authenticatedUser[key] === '' || authenticatedUser[key] === null) {\n delete authenticatedUser[key];\n }\n });\n\n basicUserInfo = {...basicUserInfo, ...authenticatedUser};\n\n return basicUserInfo;\n }\n\n public async getDecodedIDToken(userID?: string): Promise<IdTokenPayload> {\n const idToken: string = (await this._dataLayer.getSessionData(userID)).id_token;\n const payload: IdTokenPayload = this._cryptoHelper.decodeIDToken(idToken);\n\n return payload;\n }\n\n public async getCryptoHelper(): Promise<IsomorphicCrypto> {\n return this._cryptoHelper;\n }\n\n public async getIDToken(userID?: string): Promise<string> {\n return (await this._dataLayer.getSessionData(userID)).id_token;\n }\n\n public async getOIDCProviderMetaData(forceInit: boolean): Promise<void> {\n const configData: StrictAuthClientConfig = await this._config();\n\n if (\n !forceInit &&\n (await this._dataLayer.getTemporaryDataParameter(\n OIDCDiscoveryConstants.Storage.StorageKeys.OPENID_PROVIDER_CONFIG_INITIATED,\n ))\n ) {\n return Promise.resolve();\n }\n\n const wellKnownEndpoint: string = (configData as any).wellKnownEndpoint;\n\n if (wellKnownEndpoint) {\n let response: Response;\n\n try {\n response = await fetch(wellKnownEndpoint);\n if (response.status !== 200 || !response.ok) {\n throw new Error();\n }\n } catch {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-GOPMD-HE01',\n 'Invalid well-known response',\n 'The well known endpoint response has been failed with an error.',\n );\n }\n\n await this._dataLayer.setOIDCProviderMetaData(\n await this._authenticationHelper.resolveEndpoints(await response.json()),\n );\n await this._dataLayer.setTemporaryDataParameter(\n OIDCDiscoveryConstants.Storage.StorageKeys.OPENID_PROVIDER_CONFIG_INITIATED,\n true,\n );\n\n return Promise.resolve();\n } else if ((configData as any).baseUrl) {\n try {\n await this._dataLayer.setOIDCProviderMetaData(await this._authenticationHelper.resolveEndpointsByBaseURL());\n } catch (error: any) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-GOPMD-IV02',\n 'Resolving endpoints failed.',\n error ?? 'Resolving endpoints by base url failed.',\n );\n }\n await this._dataLayer.setTemporaryDataParameter(\n OIDCDiscoveryConstants.Storage.StorageKeys.OPENID_PROVIDER_CONFIG_INITIATED,\n true,\n );\n\n return Promise.resolve();\n } else {\n await this._dataLayer.setOIDCProviderMetaData(await this._authenticationHelper.resolveEndpointsExplicitly());\n\n await this._dataLayer.setTemporaryDataParameter(\n OIDCDiscoveryConstants.Storage.StorageKeys.OPENID_PROVIDER_CONFIG_INITIATED,\n true,\n );\n\n return Promise.resolve();\n }\n }\n\n // TODO: Remove `Partial<OIDCEndpoints>` once the refactoring is done.\n public async getOIDCServiceEndpoints(): Promise<Partial<OIDCEndpoints>> {\n const oidcProviderMetaData: OIDCDiscoveryApiResponse = await this._oidcProviderMetaData();\n\n return {\n authorizationEndpoint: oidcProviderMetaData.authorization_endpoint ?? '',\n checkSessionIframe: oidcProviderMetaData.check_session_iframe ?? '',\n endSessionEndpoint: oidcProviderMetaData.end_session_endpoint ?? '',\n introspectionEndpoint: oidcProviderMetaData.introspection_endpoint ?? '',\n issuer: oidcProviderMetaData.issuer ?? '',\n jwksUri: oidcProviderMetaData.jwks_uri ?? '',\n registrationEndpoint: oidcProviderMetaData.registration_endpoint ?? '',\n revocationEndpoint: oidcProviderMetaData.revocation_endpoint ?? '',\n tokenEndpoint: oidcProviderMetaData.token_endpoint ?? '',\n userinfoEndpoint: oidcProviderMetaData.userinfo_endpoint ?? '',\n };\n }\n\n public async getSignOutURL(userID?: string): Promise<string> {\n const logoutEndpoint: string | undefined = (await this._oidcProviderMetaData())?.end_session_endpoint;\n const configData: StrictAuthClientConfig = await this._config();\n\n if (!logoutEndpoint || logoutEndpoint.trim().length === 0) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-GSOU-NF01',\n 'Sign-out endpoint not found.',\n 'No sign-out endpoint was found in the OIDC provider meta data returned by the well-known endpoint ' +\n 'or the sign-out endpoint passed to the SDK is empty.',\n );\n }\n\n const callbackURL: string = configData?.signOutRedirectURL ?? configData?.signInRedirectURL;\n\n if (!callbackURL || callbackURL.trim().length === 0) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-GSOU-NF03',\n 'No sign-out redirect URL found.',\n 'The sign-out redirect URL cannot be found or the URL passed to the SDK is empty. ' +\n 'No sign-in redirect URL has been found either. ',\n );\n }\n const queryParams: URLSearchParams = new URLSearchParams();\n\n queryParams.set('post_logout_redirect_uri', callbackURL);\n\n if (configData.sendIdTokenInLogoutRequest) {\n const idToken: string = (await this._dataLayer.getSessionData(userID))?.id_token;\n\n if (!idToken || idToken.trim().length === 0) {\n throw new AsgardeoAuthException(\n 'JS-AUTH_CORE-GSOU-NF02',\n 'ID token not found.',\n 'No ID token could be found. Either the session information is lost or you have not signed in.',\n );\n }\n queryParams.set('id_token_hint', idToken);\n } else {\n queryParams.set('client_id', configData.clientID);\n }\n\n queryParams.set('state', OIDCRequestConstants.Params.SIGN_OUT_SUCCESS);\n\n return `${logoutEndpoint}?${queryParams.toString()}`;\n }\n\n public async clearUserSessionData(userID?: string): Promise<void> {\n await this._authenticationHelper.clearUserSessionData(userID);\n }\n\n public async getAccessToken(userID?: string): Promise<string> {\n return (await this._dataLayer.getSessionData(userID))?.access_token;\n }\n\n /**\n * The created timestamp of the token response in milliseconds.\n *\n * @param userID - User ID\n * @returns Created at timestamp of the token response in milliseconds.\n */\n public async getCreatedAt(userID?: string): Promise<number> {\n return (await this._dataLayer.getSessionData(userID))?.created_at;\n }\n\n /**\n * The expires timestamp of the token response in seconds.\n *\n * @param userID - User ID\n * @returns Expires in timestamp of the token response in seconds.\n */\n public async getExpiresIn(userID?: string): Promise<string> {\n return (await this._dataLayer.getSessionData(userID))?.expires_in;\n }\n\n public async isAuthenticated(userID?: string): Promise<boolean> {\n const isAccessTokenAvailable: boolean = Boolean(await this.getAccessToken(userID));\n\n // Check if the access token is expired.\n const createdAt: number = await this.getCreatedAt(userID);\n\n // Get the expires in value.\n const expiresInString: string = await this.getExpiresIn(userID);\n\n // If the expires in value is not available, the token is invalid and the user is not authenticated.\n if (!expiresInString) {\n return false;\n }\n\n // Convert to milliseconds.\n const expiresIn: number = parseInt(expiresInString) * 1000;\n const currentTime: number = new Date().getTime();\n const isAccessTokenValid: boolean = createdAt + expiresIn > currentTime;\n\n const isAuthenticated: boolean = isAccessTokenAvailable && isAccessTokenValid;\n\n return isAuthenticated;\n }\n\n public async getPKCECode(state: string, userID?: string): Promise<string> {\n return (await this._dataLayer.getTemporaryDataParameter(extractPkceStorageKeyFromState(state), userID)) as string;\n }\n\n public async setPKCECode(pkce: string, state: string, userID?: string): Promise<void> {\n return await this._dataLayer.setTemporaryDataParameter(extractPkceStorageKeyFromState(state), pkce, userID);\n }\n\n public async updateConfig(config: Partial<AuthClientConfig<T>>): Promise<void> {\n await this._dataLayer.setConfigData(config);\n await this.getOIDCProviderMetaData(true);\n }\n}\n", "/**\n * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {Stores} from '../../models/store';\nimport {Store} from '../../models/store';\nimport {AuthClientConfig, SessionData} from '../models';\nimport {TemporaryStore, TemporaryStoreValue} from '../../models/store';\nimport {OIDCDiscoveryApiResponse} from '../../models/oidc-discovery';\n\ntype PartialData<T> = Partial<AuthClientConfig<T> | OIDCDiscoveryApiResponse | SessionData | TemporaryStore>;\n\nexport const ASGARDEO_SESSION_ACTIVE: string = 'asgardeo-session-active';\n\nexport class DataLayer<T> {\n protected _id: string;\n protected _store: Store;\n public constructor(instanceID: string, store: Store) {\n this._id = instanceID;\n this._store = store;\n }\n\n protected async setDataInBulk(key: string, data: PartialData<T>): Promise<void> {\n const existingDataJSON: string = (await this._store.getData(key)) ?? null;\n const existingData: PartialData<T> = existingDataJSON && JSON.parse(existingDataJSON);\n\n const dataToBeSaved: PartialData<T> = {...existingData, ...data};\n const dataToBeSavedJSON: string = JSON.stringify(dataToBeSaved);\n\n await this._store.setData(key, dataToBeSavedJSON);\n }\n\n protected async setValue(\n key: string,\n attribute: keyof AuthClientConfig<T> | keyof OIDCDiscoveryApiResponse | keyof SessionData | keyof TemporaryStore,\n value: TemporaryStoreValue,\n ): Promise<void> {\n const existingDataJSON: string = (await this._store.getData(key)) ?? null;\n const existingData: PartialData<T> = existingDataJSON && JSON.parse(existingDataJSON);\n\n const dataToBeSaved: PartialData<T> = {...existingData, [attribute]: value};\n const dataToBeSavedJSON: string = JSON.stringify(dataToBeSaved);\n\n await this._store.setData(key, dataToBeSavedJSON);\n }\n\n protected async removeValue(\n key: string,\n attribute: keyof AuthClientConfig<T> | keyof OIDCDiscoveryApiResponse | keyof SessionData | keyof TemporaryStore,\n ): Promise<void> {\n const existingDataJSON: string = (await this._store.getData(key)) ?? null;\n const existingData: PartialData<T> = existingDataJSON && JSON.parse(existingDataJSON);\n\n const dataToBeSaved: PartialData<T> = {...existingData};\n\n delete dataToBeSaved[attribute as string];\n\n const dataToBeSavedJSON: string = JSON.stringify(dataToBeSaved);\n\n await this._store.setData(key, dataToBeSavedJSON);\n }\n\n protected _resolveKey(store: Stores | string, userID?: string): string {\n return userID ? `${store}-${this._id}-${userID}` : `${store}-${this._id}`;\n }\n\n protected isLocalStorageAvailable(): boolean {\n try {\n const testValue: string = '__ASGARDEO_AUTH_CORE_LOCAL_STORAGE_TEST__';\n\n localStorage.setItem(testValue, testValue);\n localStorage.removeItem(testValue);\n\n return true;\n } catch (error) {\n return false;\n }\n }\n\n public async setConfigData(config: Partial<AuthClientConfig<T>>): Promise<void> {\n await this.setDataInBulk(this._resolveKey(Stores.ConfigData), config);\n }\n\n public async setOIDCProviderMetaData(oidcProviderMetaData: Partial<OIDCDiscoveryApiResponse>): Promise<void> {\n this.setDataInBulk(this._resolveKey(Stores.OIDCProviderMetaData), oidcProviderMetaData);\n }\n\n public async setTemporaryData(temporaryData: Partial<TemporaryStore>, userID?: string): Promise<void> {\n this.setDataInBulk(this._resolveKey(Stores.TemporaryData, userID), temporaryData);\n }\n\n public async setSessionData(sessionData: Partial<SessionData>, userID?: string): Promise<void> {\n this.setDataInBulk(this._resolveKey(Stores.SessionData, userID), sessionData);\n }\n\n public async setCustomData<K>(key: string, customData: Partial<K>, userID?: string): Promise<void> {\n this.setDataInBulk(this._resolveKey(key, userID), customData);\n }\n\n public async getConfigData(): Promise<AuthClientConfig<T>> {\n return JSON.parse((await this._store.getData(this._resolveKey(Stores.ConfigData))) ?? null);\n }\n\n public async getOIDCProviderMetaData(): Promise<OIDCDiscoveryApiResponse> {\n return JSON.parse((await this._store.getData(this._resolveKey(Stores.OIDCProviderMetaData))) ?? null);\n }\n\n public async getTemporaryData(userID?: string): Promise<TemporaryStore> {\n return JSON.parse((await this._store.getData(this._resolveKey(Stores.TemporaryData, userID))) ?? null);\n }\n\n public async getSessionData(userID?: string): Promise<SessionData> {\n return JSON.parse((await this._store.getData(this._resolveKey(Stores.SessionData, userID))) ?? null);\n }\n\n public async getCustomData<K>(key: string, userID?: string): Promise<K> {\n return JSON.parse((await this._store.getData(this._resolveKey(key, userID))) ?? null);\n }\n\n public setSessionStatus(status: string): void {\n // Using local storage to store the session status as it is required to be available across tabs.\n this.isLocalStorageAvailable() && localStorage.setItem(`${ASGARDEO_SESSION_ACTIVE}`, status);\n }\n\n public getSessionStatus(): string {\n return this.isLocalStorageAvailable() ? localStorage.getItem(`${ASGARDEO_SESSION_ACTIVE}`) ?? '' : '';\n }\n\n public removeSessionStatus(): void {\n this.isLocalStorageAvailable() && localStorage.removeItem(`${ASGARDEO_SESSION_ACTIVE}`);\n }\n\n public async removeConfigData(): Promise<void> {\n await this._store.removeData(this._resolveKey(Stores.ConfigData));\n }\n\n public async removeOIDCProviderMetaData(): Promise<void> {\n await this._store.removeData(this._resolveKey(Stores.OIDCProviderMetaData));\n }\n\n public async removeTemporaryData(userID?: string): Promise<void> {\n await this._store.removeData(this._resolveKey(Stores.TemporaryData, userID));\n }\n\n public async removeSessionData(userID?: string): Promise<void> {\n await this._store.removeData(this._resolveKey(Stores.SessionData, userID));\n }\n\n public async getConfigDataParameter(key: keyof AuthClientConfig<T>): Promise<TemporaryStoreValue> {\n const data: string = await this._store.getData(this._resolveKey(Stores.ConfigData));\n\n return data && JSON.parse(data)[key];\n }\n\n public async getOIDCProviderMetaDataParameter(key: keyof OIDCDiscoveryApiResponse): Promise<TemporaryStoreValue> {\n const data: string = await this._store.getData(this._resolveKey(Stores.OIDCProviderMetaData));\n\n return data && JSON.parse(data)[key];\n }\n\n public async getTemporaryDataParameter(key: keyof TemporaryStore, userID?: string): Promise<TemporaryStoreValue> {\n const data: string = await this._store.getData(this._resolveKey(Stores.TemporaryData, userID));\n\n return data && JSON.parse(data)[key];\n }\n\n public async getSessionDataParameter(key: keyof SessionData, userID?: string): Promise<TemporaryStoreValue> {\n const data: string = await this._store.getData(this._resolveKey(Stores.SessionData, userID));\n\n return data && JSON.parse(data)[key];\n }\n\n public async setConfigDataParameter(key: keyof AuthClientConfig<T>, value: TemporaryStoreValue): Promise<void> {\n await this.setValue(this._resolveKey(Stores.ConfigData), key, value);\n }\n\n public async setOIDCProviderMetaDataParameter(\n key: keyof OIDCDiscoveryApiResponse,\n value: TemporaryStoreValue,\n ): Promise<void> {\n await this.setValue(this._resolveKey(Stores.OIDCProviderMetaData), key, value);\n }\n\n public async setTemporaryDataParameter(\n key: keyof TemporaryStore,\n value: TemporaryStoreValue,\n userID?: string,\n ): Promise<void> {\n await this.setValue(this._resolveKey(Stores.TemporaryData, userID), key, value);\n }\n\n public async setSessionDataParameter(\n key: keyof SessionData,\n value: TemporaryStoreValue,\n userID?: string,\n ): Promise<void> {\n await this.setValue(this._resolveKey(Stores.SessionData, userID), key, value);\n }\n\n public async removeConfigDataParameter(key: keyof AuthClientConfig<T>): Promise<void> {\n await this.removeValue(this._resolveKey(Stores.ConfigData), key);\n }\n\n public async removeOIDCProviderMetaDataParameter(key: keyof OIDCDiscoveryApiResponse): Promise<void> {\n await this.removeValue(this._resolveKey(Stores.OIDCProviderMetaData), key);\n }\n\n public async removeTemporaryDataParameter(key: keyof TemporaryStore, userID?: string): Promise<void> {\n await this.removeValue(this._resolveKey(Stores.TemporaryData, userID), key);\n }\n\n public async removeSessionDataParameter(key: keyof SessionData, userID?: string): Promise<void> {\n await this.removeValue(this._resolveKey(Stores.SessionData, userID), key);\n }\n}\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Enum representing different OAuth response modes.\n */\nexport enum ResponseMode {\n /**\n * Response is returned as POST parameters in an HTML form.\n */\n FormPost = 'form_post',\n\n /**\n * Response is returned as query parameters in the URL.\n */\n Query = 'query',\n\n /**\n * Response is returned directly to the client.\n */\n Direct = 'direct',\n}\n", "/**\n * Copyright (c) 2020, WSO2 LLC. (https://www.wso2.com). All Rights Reserved.\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AuthenticationCore} from './core';\nimport {DataLayer} from './data';\nimport {\n AuthClientConfig,\n BasicUserInfo,\n CustomGrantConfig,\n FetchResponse,\n GetAuthURLConfig,\n} from './models';\nimport {Crypto} from '../models/crypto';\nimport {TokenResponse} from '../models/token';\nimport {IdTokenPayload} from '../models/id-token';\nimport {OIDCEndpoints} from '../models/oidc-endpoints';\nimport {Store} from '../models/store';\nimport {ResponseMode} from '../models/oauth-response';\nimport ScopeConstants from '../constants/ScopeConstants';\nimport OIDCDiscoveryConstants from '../constants/OIDCDiscoveryConstants';\nimport OIDCRequestConstants from '../constants/OIDCRequestConstants';\nimport { IsomorphicCrypto } from '../IsomorphicCrypto';\n\n/**\n * Default configurations.\n */\nconst DefaultConfig: Partial<AuthClientConfig<unknown>> = {\n clockTolerance: 300,\n enablePKCE: true,\n responseMode: ResponseMode.Query,\n scope: [ScopeConstants.OPENID],\n sendCookiesInRequests: true,\n validateIDToken: true,\n validateIDTokenIssuer: true,\n};\n\n/**\n * This class provides the necessary methods needed to implement authentication.\n */\nexport class AsgardeoAuthClient<T> {\n private _dataLayer!: DataLayer<T>;\n private _authenticationCore!: AuthenticationCore<T>;\n\n private static _instanceID: number;\n static _authenticationCore: any;\n\n /**\n * This is the constructor method that returns an instance of the .\n *\n * @param store - The store object.\n *\n * @example\n * ```\n * const _store: Store = new DataStore();\n * const auth = new AsgardeoAuthClient<CustomClientConfig>(_store);\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#constructor}\n *\n * @preserve\n */\n public constructor() {}\n\n /**\n *\n * This method initializes the SDK with the config data.\n *\n * @param config - The config object to initialize with.\n *\n * @example\n * const config = \\{\n * signInRedirectURL: \"http://localhost:3000/sign-in\",\n * clientID: \"client ID\",\n * baseUrl: \"https://localhost:9443\"\n * \\}\n *\n * await auth.initialize(config);\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#initialize}\n *\n * @preserve\n */\n public async initialize(\n config: AuthClientConfig<T>,\n store: Store,\n cryptoUtils: Crypto,\n instanceID?: number,\n ): Promise<void> {\n const clientId: string = config.clientID;\n\n if (!AsgardeoAuthClient._instanceID) {\n AsgardeoAuthClient._instanceID = 0;\n } else {\n AsgardeoAuthClient._instanceID += 1;\n }\n\n if (instanceID) {\n AsgardeoAuthClient._instanceID = instanceID;\n }\n\n if (!clientId) {\n this._dataLayer = new DataLayer<T>(`instance_${AsgardeoAuthClient._instanceID}`, store);\n } else {\n this._dataLayer = new DataLayer<T>(`instance_${AsgardeoAuthClient._instanceID}-${clientId}`, store);\n }\n\n this._authenticationCore = new AuthenticationCore(this._dataLayer, cryptoUtils);\n AsgardeoAuthClient._authenticationCore = new AuthenticationCore(this._dataLayer, cryptoUtils);\n\n await this._dataLayer.setConfigData({\n ...DefaultConfig,\n ...config,\n scope: [\n ...(DefaultConfig.scope ?? []),\n ...(config.scope?.filter((scope: string) => !DefaultConfig?.scope?.includes(scope)) ?? []),\n ],\n });\n }\n\n /**\n * This method returns the `DataLayer` object that allows you to access authentication data.\n *\n * @returns - The `DataLayer` object.\n *\n * @example\n * ```\n * const data = auth.getDataLayer();\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getDataLayer}\n *\n * @preserve\n */\n public getDataLayer(): DataLayer<T> {\n return this._dataLayer;\n }\n\n /**\n * This method returns the `instanceID` variable of the given instance.\n *\n * @returns - The `instanceID` number.\n *\n * @example\n * ```\n * const instanceId = auth.getInstanceID();\n * ```\n *\n * @preserve\n */\n public getInstanceID(): number {\n return AsgardeoAuthClient._instanceID;\n }\n\n /**\n * This is an async method that returns a Promise that resolves with the authorization URL parameters.\n *\n * @param config - (Optional) A config object to force initialization and pass\n * custom path parameters such as the `fidp` parameter.\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @returns - A promise that resolves with the authorization URL parameters.\n *\n * @example\n * ```\n * auth.getAuthorizationURLParams().then((params)=>{\n * // console.log(params);\n * }).catch((error)=>{\n * // console.error(error);\n * });\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getAuthorizationURLParams}\n *\n * @preserve\n */\n public async getAuthorizationURLParams(config?: GetAuthURLConfig, userID?: string): Promise<Map<string, string>> {\n const authRequestConfig: GetAuthURLConfig = {...config};\n\n delete authRequestConfig?.forceInit;\n\n if (\n await this._dataLayer.getTemporaryDataParameter(\n OIDCDiscoveryConstants.Storage.StorageKeys.OPENID_PROVIDER_CONFIG_INITIATED,\n )\n ) {\n return this._authenticationCore.getAuthorizationURLParams(authRequestConfig, userID);\n }\n\n return this._authenticationCore.getOIDCProviderMetaData(config?.forceInit as boolean).then(() => {\n return this._authenticationCore.getAuthorizationURLParams(authRequestConfig, userID);\n });\n }\n\n /**\n * This is an async method that returns a Promise that resolves with the authorization URL.\n *\n * @param config - (Optional) A config object to force initialization and pass\n * custom path parameters such as the fidp parameter.\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @returns - A promise that resolves with the authorization URL.\n *\n * @example\n * ```\n * auth.getAuthorizationURL().then((url)=>{\n * // console.log(url);\n * }).catch((error)=>{\n * // console.error(error);\n * });\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getAuthorizationURL}\n *\n * @preserve\n */\n public async getAuthorizationURL(config?: GetAuthURLConfig, userID?: string): Promise<string> {\n const authRequestConfig: GetAuthURLConfig = {...config};\n\n delete authRequestConfig?.forceInit;\n\n if (\n await this._dataLayer.getTemporaryDataParameter(\n OIDCDiscoveryConstants.Storage.StorageKeys.OPENID_PROVIDER_CONFIG_INITIATED,\n )\n ) {\n return this._authenticationCore.getAuthorizationURL(authRequestConfig, userID);\n }\n\n return this._authenticationCore.getOIDCProviderMetaData(config?.forceInit as boolean).then(() => {\n return this._authenticationCore.getAuthorizationURL(authRequestConfig, userID);\n });\n }\n\n /**\n * This is an async method that sends a request to obtain the access token and returns a Promise\n * that resolves with the token and other relevant data.\n *\n * @param authorizationCode - The authorization code.\n * @param sessionState - The session state.\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @returns - A Promise that resolves with the token response.\n *\n * @example\n * ```\n * auth.requestAccessToken(authCode, sessionState).then((token)=>{\n * // console.log(token);\n * }).catch((error)=>{\n * // console.error(error);\n * });\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#requestAccessToken}\n *\n *\n * @preserve\n */\n public async requestAccessToken(\n authorizationCode: string,\n sessionState: string,\n state: string,\n userID?: string,\n tokenRequestConfig?: {\n params: Record<string, unknown>;\n },\n ): Promise<TokenResponse> {\n if (\n await this._dataLayer.getTemporaryDataParameter(\n OIDCDiscoveryConstants.Storage.StorageKeys.OPENID_PROVIDER_CONFIG_INITIATED,\n )\n ) {\n return this._authenticationCore.requestAccessToken(\n authorizationCode,\n sessionState,\n state,\n userID,\n tokenRequestConfig,\n );\n }\n\n return this._authenticationCore.getOIDCProviderMetaData(false).then(() => {\n return this._authenticationCore.requestAccessToken(\n authorizationCode,\n sessionState,\n state,\n userID,\n tokenRequestConfig,\n );\n });\n }\n\n /**\n * This method returns the sign-out URL.\n *\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * **This doesn't clear the authentication data.**\n *\n * @returns - A Promise that resolves with the sign-out URL.\n *\n * @example\n * ```\n * const signOutUrl = await auth.getSignOutURL();\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getSignOutURL}\n *\n * @preserve\n */\n public async getSignOutURL(userID?: string): Promise<string> {\n return this._authenticationCore.getSignOutURL(userID);\n }\n\n /**\n * This method returns OIDC service endpoints that are fetched from the `.well-known` endpoint.\n *\n * @returns - A Promise that resolves with an object containing the OIDC service endpoints.\n *\n * @example\n * ```\n * const endpoints = await auth.getOIDCServiceEndpoints();\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getOIDCServiceEndpoints}\n *\n * @preserve\n */\n public async getOIDCServiceEndpoints(): Promise<Partial<OIDCEndpoints>> {\n return this._authenticationCore.getOIDCServiceEndpoints();\n }\n\n /**\n * This method decodes the payload of the ID token and returns it.\n *\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @returns - A Promise that resolves with the decoded ID token payload.\n *\n * @example\n * ```\n * const decodedIdToken = await auth.getDecodedIDToken();\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getDecodedIDToken}\n *\n * @preserve\n */\n public async getDecodedIDToken(userID?: string): Promise<IdTokenPayload> {\n return this._authenticationCore.getDecodedIDToken(userID);\n }\n\n /**\n * This method returns the ID token.\n *\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @returns - A Promise that resolves with the ID token.\n *\n * @example\n * ```\n * const idToken = await auth.getIDToken();\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getIDToken}\n *\n * @preserve\n */\n public async getIDToken(userID?: string): Promise<string> {\n return this._authenticationCore.getIDToken(userID);\n }\n\n /**\n * This method returns the basic user information obtained from the ID token.\n *\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @returns - A Promise that resolves with an object containing the basic user information.\n *\n * @example\n * ```\n * const userInfo = await auth.getBasicUserInfo();\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getBasicUserInfo}\n *\n * @preserve\n */\n public async getBasicUserInfo(userID?: string): Promise<BasicUserInfo> {\n return this._authenticationCore.getBasicUserInfo(userID);\n }\n\n /**\n * This method returns the crypto helper object.\n *\n * @returns - A Promise that resolves with a IsomorphicCrypto object.\n *\n * @example\n * ```\n * const cryptoHelper = await auth.IsomorphicCrypto();\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getCryptoHelper}\n *\n * @preserve\n */\n public async getCryptoHelper(): Promise<IsomorphicCrypto> {\n return this._authenticationCore.getCryptoHelper();\n }\n\n /**\n * This method revokes the access token.\n *\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * **This method also clears the authentication data.**\n *\n * @returns - A Promise that returns the response of the revoke-access-token request.\n *\n * @example\n * ```\n * auth.revokeAccessToken().then((response)=>{\n * // console.log(response);\n * }).catch((error)=>{\n * // console.error(error);\n * });\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#revokeAccessToken}\n *\n * @preserve\n */\n public revokeAccessToken(userID?: string): Promise<FetchResponse> {\n return this._authenticationCore.revokeAccessToken(userID);\n }\n\n /**\n * This method refreshes the access token and returns a Promise that resolves with the new access\n * token and other relevant data.\n *\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @returns - A Promise that resolves with the token response.\n *\n * @example\n * ```\n * auth.refreshAccessToken().then((response)=>{\n * // console.log(response);\n * }).catch((error)=>{\n * // console.error(error);\n * });\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#refreshAccessToken}\n *\n * @preserve\n */\n public refreshAccessToken(userID?: string): Promise<TokenResponse> {\n return this._authenticationCore.refreshAccessToken(userID);\n }\n\n /**\n * This method returns the access token.\n *\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @returns - A Promise that resolves with the access token.\n *\n * @example\n * ```\n * const accessToken = await auth.getAccessToken();\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getAccessToken}\n *\n * @preserve\n */\n public async getAccessToken(userID?: string): Promise<string> {\n return this._authenticationCore.getAccessToken(userID);\n }\n\n /**\n * This method sends a custom-grant request and returns a Promise that resolves with the response\n * depending on the config passed.\n *\n * @param config - A config object containing the custom grant configurations.\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @returns - A Promise that resolves with the response depending\n * on your configurations.\n *\n * @example\n * ```\n * const config = {\n * attachToken: false,\n * data: {\n * client_id: \"{{clientID}}\",\n * grant_type: \"account_switch\",\n * scope: \"{{scope}}\",\n * token: \"{{token}}\",\n * },\n * id: \"account-switch\",\n * returnResponse: true,\n * returnsSession: true,\n * signInRequired: true\n * }\n *\n * auth.requestCustomGrant(config).then((response)=>{\n * // console.log(response);\n * }).catch((error)=>{\n * // console.error(error);\n * });\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#requestCustomGrant}\n *\n * @preserve\n */\n public requestCustomGrant(config: CustomGrantConfig, userID?: string): Promise<TokenResponse | FetchResponse> {\n return this._authenticationCore.requestCustomGrant(config, userID);\n }\n\n /**\n * This method returns if the user is authenticated or not.\n *\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @returns - A Promise that resolves with `true` if the user is authenticated, `false` otherwise.\n *\n * @example\n * ```\n * await auth.isAuthenticated();\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#isAuthenticated}\n *\n * @preserve\n */\n public async isAuthenticated(userID?: string): Promise<boolean> {\n return this._authenticationCore.isAuthenticated(userID);\n }\n\n /**\n * This method returns the PKCE code generated during the generation of the authentication URL.\n *\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n * @param state - The state parameter that was passed in the authentication URL.\n *\n * @returns - A Promise that resolves with the PKCE code.\n *\n * @example\n * ```\n * const pkce = await getPKCECode();\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getPKCECode}\n *\n * @preserve\n */\n public async getPKCECode(state: string, userID?: string): Promise<string> {\n return this._authenticationCore.getPKCECode(state, userID);\n }\n\n /**\n * This method sets the PKCE code to the data store.\n *\n * @param pkce - The PKCE code.\n * @param state - The state parameter that was passed in the authentication URL.\n * @param userID - (Optional) A unique ID of the user to be authenticated. This is useful in multi-user\n * scenarios where each user should be uniquely identified.\n *\n * @example\n * ```\n * await auth.setPKCECode(\"pkce_code\")\n * ```\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#setPKCECode}\n *\n * @preserve\n */\n public async setPKCECode(pkce: string, state: string, userID?: string): Promise<void> {\n await this._authenticationCore.setPKCECode(pkce, state, userID);\n }\n\n /**\n * This method returns if the sign-out is successful or not.\n *\n * @param signOutRedirectUrl - The URL to which the user has been redirected to after signing-out.\n *\n * **The server appends path parameters to the `signOutRedirectURL` and these path parameters\n * are required for this method to function.**\n *\n * @returns - `true` if successful, `false` otherwise.\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#isSignOutSuccessful}\n *\n * @preserve\n */\n public static isSignOutSuccessful(signOutRedirectURL: string): boolean {\n const url: URL = new URL(signOutRedirectURL);\n const stateParam: string | null = url.searchParams.get(OIDCRequestConstants.Params.STATE);\n const error: boolean = Boolean(url.searchParams.get('error'));\n\n return stateParam ? stateParam === OIDCRequestConstants.Params.SIGN_OUT_SUCCESS && !error : false;\n }\n\n /**\n * This method returns if the sign-out has failed or not.\n *\n * @param signOutRedirectUrl - The URL to which the user has been redirected to after signing-out.\n *\n * **The server appends path parameters to the `signOutRedirectURL` and these path parameters\n * are required for this method to function.**\n *\n * @returns - `true` if successful, `false` otherwise.\n *\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#didSignOutFail}\n *\n * @preserve\n */\n public static didSignOutFail(signOutRedirectURL: string): boolean {\n const url: URL = new URL(signOutRedirectURL);\n const stateParam: string | null = url.searchParams.get(OIDCRequestConstants.Params.STATE);\n const error: boolean = Boolean(url.searchParams.get('error'));\n\n return stateParam ? stateParam === OIDCRequestConstants.Params.SIGN_OUT_SUCCESS && error : false;\n }\n\n /**\n * This method updates the configuration that was passed into the constructor when instantiating this class.\n *\n * @param config - A config object to update the SDK configurations with.\n *\n * @example\n * ```\n * const config = {\n * signInRedirectURL: \"http://localhost:3000/sign-in\",\n * clientID: \"client ID\",\n * baseUrl: \"https://localhost:9443\"\n * }\n *\n * await auth.updateConfig(config);\n * ```\n * {@link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#updateConfig}\n *\n * @preserve\n */\n public async updateConfig(config: Partial<AuthClientConfig<T>>): Promise<void> {\n await this._authenticationCore.updateConfig(config);\n }\n\n public static async clearUserSessionData(userID?: string): Promise<void> {\n await this._authenticationCore.clearUserSessionData(userID);\n }\n}\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Base class for all Asgardeo errors. This class extends the native Error class\n * and adds support for error codes and proper stack traces. Each error is prefixed\n * with a shield emoji and the SDK name for easy identification.\n *\n * @example\n * ```typescript\n * // Create a new error with a message and code\n * throw new AsgardeoError(\n * \"Invalid authentication response\",\n * \"AUTH_ERROR\"\n * );\n *\n * // Or with a specific SDK name\n * throw new AsgardeoError(\n * \"Invalid authentication response\",\n * \"AUTH_ERROR\",\n * \"@asgardeo/react\"\n * );\n *\n * // The error message will be formatted as:\n * // \uD83D\uDEE1\uFE0F Asgardeo React: Invalid authentication response\n * //\n * // (code=\"AUTH_ERROR\")\n */\nexport default class AsgardeoError extends Error {\n public readonly code: string;\n public readonly origin: string;\n\n private static resolveOrigin(origin: string): string {\n if (!origin) {\n return '@asgardeo/javascript';\n }\n\n return `@asgardeo/${origin}`;\n }\n\n constructor(message: string, code: string, origin: string) {\n const _origin: string = AsgardeoError.resolveOrigin(origin);\n const prefix: string = `\uD83D\uDEE1\uFE0F Asgardeo - ${_origin}:`;\n const regex: RegExp = new RegExp(`\uD83D\uDEE1\uFE0F\\\\s*Asgardeo\\\\s*-\\\\s*${_origin}:`, 'i');\n const sanitized: string = message.replace(regex, '');\n const _message: string = `${prefix} ${sanitized.trim()}\\n\\n(code=\"${code}\")\\n`;\n\n super(_message);\n\n this.name = new.target.name;\n this.code = code;\n this.origin = _origin;\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, new.target);\n }\n }\n\n public override toString(): string {\n return `[${this.name}]\\nMessage: ${this.message}`;\n }\n}\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport AsgardeoError from './AsgardeoError';\n\n/**\n * Base class for all API-related errors in Asgardeo. This class extends AsgardeoError\n * and adds support for HTTP status codes and status text.\n *\n * @example\n * ```typescript\n * throw new AsgardeoAPIError(\n * \"Failed to fetch user data\",\n * \"API_FETCH_ERROR\",\n * 404,\n * \"Not Found\"\n * );\n * ```\n */\nexport default class AsgardeoAPIError extends AsgardeoError {\n /**\n * Creates an instance of AsgardeoAPIError.\n *\n * @param message - Human-readable description of the error\n * @param code - A unique error code that identifies the error type\n * @param statusCode - HTTP status code of the failed request\n * @param statusText - HTTP status text of the failed request\n * @param origin - Optional. The SDK origin (e.g. 'react', 'vue'). Defaults to generic 'Asgardeo'\n * @constructor\n */\n constructor(\n message: string,\n code: string,\n origin: string,\n public readonly statusCode?: number,\n public readonly statusText?: string,\n ) {\n super(message, code, origin);\n\n Object.defineProperty(this, 'name', {\n value: 'AsgardeoAPIError',\n configurable: true,\n writable: true,\n });\n }\n\n /**\n * Returns a string representation of the API error\n * @returns Formatted error string with name, code, status, and message\n */\n public override toString(): string {\n const status = this.statusCode ? ` (HTTP ${this.statusCode} - ${this.statusText})` : '';\n return `[${this.name}] (code=\"${this.code}\")${status}\\nMessage: ${this.message}`;\n }\n}\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User} from '../../models/user';\nimport AsgardeoAPIError from '../../errors/AsgardeoAPIError';\n\n/**\n * Retrieves the user information from the specified OIDC userinfo endpoint.\n *\n * @param requestConfig - Request configuration object.\n * @returns A promise that resolves with the user information.\n * @throw\n * const userInfo = await getUserInfo({\n * url: \"https://api.asgardeo.io/t/<ORGANIZATION>/oauth2/userinfo\",\n * });\n * console.log(userInfo);\n * } catch (error) {\n * if (error instanceof AsgardeoAPIError) {\n * console.error('Failed to get user info:', error.message);\n * }\n * }\n * ```\n */\nconst getUserInfo = async ({url, ...requestConfig}: Partial<Request>): Promise<User> => {\n try {\n new URL(url);\n } catch (error) {\n throw new AsgardeoAPIError(\n 'Invalid endpoint URL provided',\n 'getUserInfo-ValidationError-001',\n 'javascript',\n 400,\n 'Invalid Request',\n );\n }\n\n const response: Response = await fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n },\n ...requestConfig,\n });\n\n if (!response.ok) {\n const errorText = await response.text();\n\n throw new AsgardeoAPIError(\n `Failed to fetch user info: ${errorText}`,\n 'getUserInfo-ResponseError-001',\n 'javascript',\n response.status,\n response.statusText,\n );\n }\n\n return await response.json() as User;\n};\n\nexport default getUserInfo;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport AsgardeoError from './AsgardeoError';\n\n/**\n * Base class for all runtime errors in Asgardeo. This class extends AsgardeoError\n * and adds support for additional error details. Use this class for errors that occur\n * during runtime execution that are not related to API calls.\n *\n * @example\n * ```typescript\n * throw new AsgardeoRuntimeError(\n * \"Failed to parse configuration\",\n * \"CONFIG_PARSE_ERROR\",\n * { invalidField: \"redirectUri\" }\n * );\n * ```\n */\nexport default class AsgardeoRuntimeError extends AsgardeoError {\n /**\n * Creates an instance of AsgardeoRuntimeError.\n *\n * @param message - Human-readable description of the error\n * @param code - A unique error code that identifies the error type\n * @param details - Additional details about the error that might be helpful for debugging\n * @param origin - Optional. The SDK origin (e.g. 'react', 'vue'). Defaults to generic 'Asgardeo'\n * @constructor\n */\n constructor(message: string, code: string, origin: string, public readonly details?: unknown) {\n super(message, code, origin);\n\n Object.defineProperty(this, 'name', {\n value: 'AsgardeoRuntimeError',\n configurable: true,\n writable: true,\n });\n }\n\n /**\n * Returns a string representation of the runtime error\n * @returns Formatted error string with name, code, details, and message\n */\n public override toString(): string {\n const details = this.details ? `\\nDetails: ${JSON.stringify(this.details, null, 2)}` : '';\n return `[${this.name}] (code=\"${this.code}\")${details}\\nMessage: ${this.message}`;\n }\n}\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nexport interface SchemaAttribute {\n name: string;\n type: string;\n multiValued: boolean;\n description?: string;\n required?: boolean;\n caseExact: boolean;\n mutability: string;\n returned: string;\n uniqueness: string;\n displayName?: string;\n displayOrder?: string;\n regEx?: string;\n supportedByDefault?: string;\n sharedProfileValueResolvingMethod?: string;\n subAttributes?: SchemaAttribute[];\n}\n\n/**\n * Represents a SCIM2 schema definition\n */\nexport interface Schema {\n /** Schema identifier */\n id: string;\n /** Schema name */\n name: string;\n /** Schema description */\n description: string;\n /** Schema attributes */\n attributes: SchemaAttribute[];\n}\n\n/**\n * Well-known SCIM2 schema IDs\n */\nexport enum WellKnownSchemaIds {\n /** Core Schema */\n Core = 'urn:ietf:params:scim:schemas:core:2.0',\n /** User Schema */\n User = 'urn:ietf:params:scim:schemas:core:2.0:User',\n /** Enterprise User Schema */\n EnterpriseUser = 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User',\n /** System User Schema */\n SystemUser = 'urn:scim:wso2:schema',\n /** Custom User Schema */\n CustomUser = 'urn:scim:schemas:extension:custom:User',\n}\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {AsgardeoClient, SignInOptions, SignOutOptions} from './models/client';\nimport {User} from './models/user';\nimport {Config} from './models/config';\n\n/**\n * Base class for implementing Asgardeo clients.\n * This class provides the core functionality for managing user authentication and sessions.\n *\n * @typeParam T - Configuration type that extends Config.\n */\nabstract class AsgardeoJavaScriptClient<T = Config> implements AsgardeoClient<T> {\n /**\n * Initializes the authentication client with provided configuration.\n *\n * @param config - SDK Client instance configuration options.\n * @returns Promise resolving to boolean indicating success.\n */\n abstract initialize(config: T): Promise<boolean>;\n\n /**\n * Gets user information from the session.\n *\n * @returns User object containing user details.\n */\n abstract getUser(): Promise<User>;\n\n /**\n * Checks if the client is currently loading.\n * This can be used to determine if the client is in the process of initializing or fetching user data.\n *\n * @returns Boolean indicating if the client is loading.\n */\n abstract isLoading(): boolean;\n\n /**\n * Checks if a user is signed in.\n * FIXME: Check if this should return a boolean or a Promise<boolean>.\n *\n * @returns Promise resolving to boolean indicating sign-in status.\n */\n abstract isSignedIn(): Promise<boolean>;\n\n /**\n * Initiates the sign-in process for the user.\n *\n * @param options - Optional sign-in options like additional parameters to be sent in the authorize request, etc.\n * @returns Promise resolving the user upon successful sign in.\n */\n abstract signIn(options?: SignInOptions): Promise<User>;\n\n /**\n * Signs out the currently signed-in user.\n *\n * @param options - Optional sign-out options like additional parameters to be sent in the sign-out request, etc.\n * @param afterSignOut - Callback function to be executed after sign-out is complete.\n * @returns A promise that resolves to true if sign-out is successful\n */\n abstract signOut(options?: SignOutOptions, afterSignOut?: (redirectUrl: string) => void): Promise<string>;\n\n /**\n * Signs out the currently signed-in user with an optional session ID.\n *\n * @param options - Optional sign-out options like additional parameters to be sent in the sign-out request, etc.\n * @param sessionId - Optional session ID to be used for sign-out.\n * This can be useful in scenarios where multiple sessions are managed.\n * @param afterSignOut - Callback function to be executed after sign-out is complete.\n * @returns A promise that resolves to true if sign-out is successful\n */\n abstract signOut(\n options?: SignOutOptions,\n sessionId?: string,\n afterSignOut?: (redirectUrl: string) => void,\n ): Promise<string>;\n}\n\nexport default AsgardeoJavaScriptClient;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport { RecursivePartial } from '../models/utility-types';\nimport {Theme, ThemeConfig} from './types';\n\nconst lightTheme: ThemeConfig = {\n colors: {\n primary: {\n main: '#1a73e8',\n contrastText: '#ffffff',\n },\n secondary: {\n main: '#424242',\n contrastText: '#ffffff',\n },\n background: {\n surface: '#f5f5f5',\n disabled: '#f0f0f0',\n body: {\n main: '#1a1a1a',\n },\n },\n error: {\n main: '#d32f2f',\n contrastText: '#ffffff',\n },\n surface: '#f5f5f5',\n text: {\n primary: '#1a1a1a',\n secondary: '#666666',\n },\n border: '#e0e0e0',\n },\n spacing: {\n unit: 8,\n },\n borderRadius: {\n small: '4px',\n medium: '8px',\n large: '16px',\n },\n};\n\nconst darkTheme: ThemeConfig = {\n colors: {\n primary: {\n main: '#1a73e8',\n contrastText: '#ffffff',\n },\n secondary: {\n main: '#424242',\n contrastText: '#ffffff',\n },\n background: {\n surface: '#121212',\n disabled: '#1f1f1f',\n body: {\n main: '#ffffff',\n },\n },\n error: {\n main: '#d32f2f',\n contrastText: '#ffffff',\n },\n surface: '#2d2d2d',\n text: {\n primary: '#ffffff',\n secondary: '#b3b3b3',\n },\n border: '#404040',\n },\n spacing: {\n unit: 8,\n },\n borderRadius: {\n small: '4px',\n medium: '8px',\n large: '16px',\n },\n};\n\nconst toCssVariables = (theme: RecursivePartial<ThemeConfig>): Record<string, string> => {\n const cssVars: Record<string, string> = {};\n\n // Colors\n cssVars['--asgardeo-color-primary-main'] = theme.colors.primary.main;\n cssVars['--asgardeo-color-primary-contrastText'] = theme.colors.primary.contrastText;\n cssVars['--asgardeo-color-secondary-main'] = theme.colors.secondary.main;\n cssVars['--asgardeo-color-secondary-contrastText'] = theme.colors.secondary.contrastText;\n cssVars['--asgardeo-color-background-surface'] = theme.colors.background.surface;\n cssVars['--asgardeo-color-background-disabled'] = theme.colors.background.disabled;\n cssVars['--asgardeo-color-background-body-main'] = theme.colors.background.body.main;\n cssVars['--asgardeo-color-error-main'] = theme.colors.error.main;\n cssVars['--asgardeo-color-error-contrastText'] = theme.colors.error.contrastText;\n cssVars['--asgardeo-color-surface'] = theme.colors.surface;\n cssVars['--asgardeo-color-text-primary'] = theme.colors.text.primary;\n cssVars['--asgardeo-color-text-secondary'] = theme.colors.text.secondary;\n cssVars['--asgardeo-color-border'] = theme.colors.border;\n\n // Spacing\n cssVars['--asgardeo-spacing-unit'] = `${theme.spacing.unit}px`;\n\n // Border Radius\n cssVars['--asgardeo-border-radius-small'] = theme.borderRadius.small;\n cssVars['--asgardeo-border-radius-medium'] = theme.borderRadius.medium;\n cssVars['--asgardeo-border-radius-large'] = theme.borderRadius.large;\n\n return cssVars;\n};\n\nconst createTheme = (config: RecursivePartial<ThemeConfig> = {}, isDark = false): Theme => {\n const baseTheme = isDark ? darkTheme : lightTheme;\n const mergedConfig = {\n ...baseTheme,\n ...config,\n colors: {\n ...baseTheme.colors,\n ...config.colors,\n secondary: {\n ...baseTheme.colors.secondary,\n ...(config.colors?.secondary || {}),\n },\n },\n spacing: {\n ...baseTheme.spacing,\n ...config.spacing,\n },\n borderRadius: {\n ...baseTheme.borderRadius,\n ...config.borderRadius,\n },\n } as ThemeConfig;\n\n return {\n ...mergedConfig,\n cssVariables: toCssVariables(mergedConfig),\n };\n};\n\nexport default createTheme;\n", "/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Removes a trailing slash from a path string if it exists.\n *\n * @param path - The string path to process\n * @returns The path without a trailing slash\n *\n * @example\n * ```typescript\n * removeTrailingSlash('/path/to/something/') // returns '/path/to/something'\n * removeTrailingSlash('/path/to/something') // returns '/path/to/something'\n * ```\n */\nconst removeTrailingSlash = (path: string): string => (path.endsWith('/') ? path.slice(0, -1) : path);\n\nexport default removeTrailingSlash;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACmCA,IAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAIpB,SAAS;AAAA;AAAA;AAAA;AAAA,IAIP,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMX,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA,MAMf,WAAW;AAAA,IACb;AAAA,EACF;AACF;AAEA,IAAO,wBAAQ;;;AC3Bf,IAAM,iCAAiC,CAAC,UAA0B;AAChE,QAAM,QAAgB,SAAS,MAAM,MAAM,UAAU,EAAE,CAAC,CAAC;AAEzD,SAAO,GAAG,sBAAc,QAAQ,YAAY,aAAa,GAAG,sBAAc,QAAQ,YAAY,SAAS,GAAG,KAAK;AACjH;AAEA,I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iC,IAAI,MAAM,OAAO,KAAK;AAC/D,UAAQ,yBAAyB,IAAI,MAAM,OAAO;AAGlD,UAAQ,yBAAyB,IAAI,GAAG,MAAM,QAAQ,IAAI;AAG1D,UAAQ,gCAAgC,IAAI,MAAM,aAAa;AAC/D,UAAQ,iCAAiC,IAAI,MAAM,aAAa;AAChE,UAAQ,gCAAgC,IAAI,MAAM,aAAa;AAE/D,SAAO;AACT;AAEA,IAAM,cAAc,CAAC,SAAwC,CAAC,GAAG,SAAS,UAAiB;AACzF,QAAM,YAAY,SAAS,YAAY;AACvC,QAAM,eAAe;AAAA,IACnB,GAAG;AAAA,IACH,GAAG;AAAA,IACH,QAAQ;AAAA,MACN,GAAG,UAAU;AAAA,MACb,GAAG,OAAO;AAAA,MACV,WAAW;AAAA,QACT,GAAG,UAAU,OAAO;AAAA,QACpB,GAAI,OAAO,QAAQ,aAAa,CAAC;AAAA,MACnC;AAAA,IACF;AAAA,IACA,SAAS;AAAA,MACP,GAAG,UAAU;AAAA,MACb,GAAG,OAAO;AAAA,IACZ;AAAA,IACA,cAAc;AAAA,MACZ,GAAG,UAAU;AAAA,MACb,GAAG,OAAO;AAAA,IACZ;AAAA,EACF;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,cAAc,eAAe,YAAY;AAAA,EAC3C;AACF;AAEA,IAAO,sBAAQ;;;AC7Hf,IAAM,sBAAsB,CAAC,SAA0B,KAAK,SAAS,GAAG,IAAI,KAAK,MAAM,GAAG,EAAE,IAAI;AAEhG,IAAO,8BAAQ;",
6
+ "names": ["ResponseMode", "WellKnownSchemaIds"]
7
+ }
@@ -0,0 +1,153 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
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
+ /**
19
+ * Constants related to OpenID Connect (OIDC) metadata and endpoints.
20
+ * This object contains all the standard OIDC endpoints and storage keys
21
+ * used throughout the application for authentication and authorization.
22
+ *
23
+ * @remarks
24
+ * The constants are organized into two main sections:
25
+ * 1. Endpoints - Contains all OIDC standard endpoint paths
26
+ * 2. Storage - Contains keys used for storing OIDC-related data
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * // Using an endpoint
31
+ * const authEndpoint = OIDCDiscoveryConstants.Endpoints.AUTHORIZATION;
32
+ *
33
+ * // Using a storage key
34
+ * const tokenKey = OIDCDiscoveryConstants.Storage.StorageKeys.Endpoints.TOKEN;
35
+ * ```
36
+ */
37
+ declare const OIDCDiscoveryConstants: {
38
+ /**
39
+ * Collection of standard OIDC endpoint paths used for authentication flows.
40
+ * These endpoints are relative paths that should be appended to the base URL
41
+ * of your identity provider.
42
+ */
43
+ readonly Endpoints: {
44
+ /**
45
+ * Authorization endpoint for initiating the OAuth2/OIDC flow.
46
+ * This endpoint is used to request authorization and receive an authorization code.
47
+ */
48
+ readonly AUTHORIZATION: "/oauth2/authorize";
49
+ /**
50
+ * Session check iframe endpoint for session management.
51
+ * Used to monitor the user's session state through a hidden iframe.
52
+ */
53
+ readonly SESSION_IFRAME: "/oidc/checksession";
54
+ /**
55
+ * End session endpoint for logout functionality.
56
+ * Used to terminate the user's session and perform logout operations.
57
+ */
58
+ readonly END_SESSION: "/oidc/logout";
59
+ /**
60
+ * Token issuer endpoint.
61
+ * The endpoint that issues OAuth2/OIDC tokens.
62
+ */
63
+ readonly ISSUER: "/oauth2/token";
64
+ /**
65
+ * JSON Web Key Set endpoint for key validation.
66
+ * Provides the public keys used to verify token signatures.
67
+ */
68
+ readonly JWKS: "/oauth2/jwks";
69
+ /**
70
+ * Token revocation endpoint.
71
+ * Used to invalidate access or refresh tokens before they expire.
72
+ */
73
+ readonly REVOCATION: "/oauth2/revoke";
74
+ /**
75
+ * Token endpoint for obtaining access tokens.
76
+ * Used to exchange authorization codes for access tokens and refresh tokens.
77
+ */
78
+ readonly TOKEN: "/oauth2/token";
79
+ /**
80
+ * UserInfo endpoint for obtaining user claims.
81
+ * Provides authenticated user information when called with a valid access token.
82
+ */
83
+ readonly USERINFO: "/oauth2/userinfo";
84
+ };
85
+ /**
86
+ * Storage related constants used for maintaining OIDC state.
87
+ * These constants define the keys used to store OIDC-related data
88
+ * in the browser's storage mechanisms.
89
+ */
90
+ readonly Storage: {
91
+ /**
92
+ * Storage keys for various OIDC endpoints and configurations.
93
+ * These keys are used to store endpoint URLs and configuration
94
+ * states in the browser's storage.
95
+ */
96
+ readonly StorageKeys: {
97
+ /**
98
+ * Collection of storage keys for OIDC endpoints.
99
+ * These keys are used to store the discovered endpoint URLs
100
+ * from the OpenID Provider's configuration.
101
+ */
102
+ readonly Endpoints: {
103
+ /**
104
+ * Storage key for the authorization endpoint URL.
105
+ * Used to store the URL where authorization requests should be sent.
106
+ */
107
+ readonly AUTHORIZATION: "authorization_endpoint";
108
+ /**
109
+ * Storage key for the token endpoint URL.
110
+ * Used to store the URL where token requests should be sent.
111
+ */
112
+ readonly TOKEN: "token_endpoint";
113
+ /**
114
+ * Storage key for the revocation endpoint URL.
115
+ * Used to store the URL where token revocation requests should be sent.
116
+ */
117
+ readonly REVOCATION: "revocation_endpoint";
118
+ /**
119
+ * Storage key for the end session endpoint URL.
120
+ * Used to store the URL where logout requests should be sent.
121
+ */
122
+ readonly END_SESSION: "end_session_endpoint";
123
+ /**
124
+ * Storage key for the JWKS URI endpoint URL.
125
+ * Used to store the URL where JSON Web Key Sets can be retrieved.
126
+ */
127
+ readonly JWKS: "jwks_uri";
128
+ /**
129
+ * Storage key for the session check iframe URL.
130
+ * Used to store the URL of the iframe used for session state monitoring.
131
+ */
132
+ readonly SESSION_IFRAME: "check_session_iframe";
133
+ /**
134
+ * Storage key for the issuer identifier URL.
135
+ * Used to store the URL that identifies the OpenID Provider.
136
+ */
137
+ readonly ISSUER: "issuer";
138
+ /**
139
+ * Storage key for the userinfo endpoint URL.
140
+ * Used to store the URL where user information can be retrieved.
141
+ */
142
+ readonly USERINFO: "userinfo_endpoint";
143
+ };
144
+ /**
145
+ * Flag to track if OpenID Provider configuration is initiated.
146
+ * Used to determine if the OIDC discovery process has been started.
147
+ * This helps prevent duplicate initialization attempts.
148
+ */
149
+ readonly OPENID_PROVIDER_CONFIG_INITIATED: "op_config_initiated";
150
+ };
151
+ };
152
+ };
153
+ export default OIDCDiscoveryConstants;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
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
+ /**
19
+ * Constants representing standard OpenID Connect (OIDC) request and response parameters.
20
+ * These parameters are commonly used during authorization, token exchange, and logout flows.
21
+ */
22
+ declare const OIDCRequestConstants: {
23
+ readonly Params: {
24
+ /**
25
+ * The authorization code returned from the authorization endpoint.
26
+ * Used in the authorization code flow.
27
+ */
28
+ readonly AUTHORIZATION_CODE: "code";
29
+ /**
30
+ * Session state parameter used for session management between the client and the OP.
31
+ */
32
+ readonly SESSION_STATE: "session_state";
33
+ /**
34
+ * State parameter used to maintain state between the request and the callback.
35
+ * Helps in preventing CSRF attacks.
36
+ */
37
+ readonly STATE: "state";
38
+ /**
39
+ * Indicates whether sign-out was successful during the end-session flow.
40
+ * May be returned by the OP after a logout request.
41
+ */
42
+ readonly SIGN_OUT_SUCCESS: "sign_out_success";
43
+ };
44
+ /**
45
+ * Sign-out related constants for managing the end-session flow in OIDC.
46
+ */
47
+ readonly SignOut: {
48
+ /**
49
+ * Storage-related constants for managing sign-out state.
50
+ */
51
+ readonly Storage: {
52
+ /**
53
+ * Collection of storage keys used in sign-out implementation
54
+ */
55
+ readonly StorageKeys: {
56
+ /**
57
+ * Storage key for the sign-out URL.
58
+ * Used to store the complete URL where the user should be redirected after
59
+ * completing the OIDC logout process.
60
+ */
61
+ readonly SIGN_OUT_URL: "sign_out_url";
62
+ };
63
+ };
64
+ };
65
+ };
66
+ export default OIDCRequestConstants;