@asgardeo/node 0.0.50 → 0.0.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts", "../../src/__legacy__/core/authentication.ts", "../../src/__legacy__/stores/memory-cache-store.ts", "../../src/__legacy__/utils/session-utils.ts", "../../src/__legacy__/constants/uuid-config.ts", "../../src/__legacy__/constants/logger-config.ts", "../../src/__legacy__/utils/logger-utils.ts", "../../src/__legacy__/utils/crypto-utils.ts", "../../src/__legacy__/client.ts", "../../src/constants/CookieConfig.ts", "../../src/utils/generateSessionId.ts", "../../src/utils/getSessionCookieOptions.ts", "../../src/AsgardeoNodeClient.ts"],
4
- "sourcesContent": ["/**\n * Copyright (c) 2022, WSO2 Inc. (http://www.wso2.com) All Rights Reserved.\n *\n * WSO2 Inc. 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//Add Ponyfills for Fetch API\nimport fetch, { Headers, Request, Response } from \"cross-fetch\";\n\nif (!globalThis.fetch) {\n globalThis.fetch = fetch;\n globalThis.Headers = Headers;\n globalThis.Request = Request;\n globalThis.Response = Response;\n}\n\nexport {AsgardeoNodeClient as LegacyAsgardeoNodeClient} from './__legacy__/client';\nexport * from './__legacy__/models';\nexport * from './__legacy__/utils/logger-utils';\n\nexport {default as CookieConfig} from './constants/CookieConfig';\n\nexport {AsgardeoNodeConfig} from './models/config';\nexport {CookieOptions} from './models/cookies';\n\nexport {default as generateSessionId} from './utils/generateSessionId';\nexport {default as getSessionCookieOptions} from './utils/getSessionCookieOptions';\n\nexport {default as AsgardeoNodeClient} from './AsgardeoNodeClient';\n\nexport * from '@asgardeo/javascript';\n", "/**\n * Copyright (c) 2022, WSO2 Inc. (http://www.wso2.com) All Rights Reserved.\n *\n * WSO2 Inc. 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 {\n AsgardeoAuthClient,\n AsgardeoAuthException,\n AuthClientConfig,\n Crypto,\n TokenExchangeRequestConfig,\n StorageManager,\n IdToken,\n OIDCEndpoints,\n SessionData,\n Storage,\n TokenResponse,\n User,\n} from '@asgardeo/javascript';\nimport {AuthURLCallback} from '../models';\nimport {MemoryCacheStore} from '../stores';\nimport {Logger, SessionUtils} from '../utils';\nimport {NodeCryptoUtils} from '../utils/crypto-utils';\n\nexport class AsgardeoNodeCore<T> {\n private _auth: AsgardeoAuthClient<T>;\n private _cryptoUtils: Crypto;\n private _store: Storage;\n private _storageManager: StorageManager<T>;\n\n constructor(config: AuthClientConfig<T>, store?: Storage) {\n //Initialize the default memory cache store if an external store is not passed.\n if (!store) {\n this._store = new MemoryCacheStore();\n } else {\n this._store = store;\n }\n this._cryptoUtils = new NodeCryptoUtils();\n this._auth = new AsgardeoAuthClient();\n this._auth.initialize(config, this._store, this._cryptoUtils);\n this._storageManager = this._auth.getStorageManager();\n Logger.debug('Initialized AsgardeoAuthClient successfully');\n }\n\n public async signIn(\n authURLCallback: AuthURLCallback,\n userId: string,\n authorizationCode?: string,\n sessionState?: string,\n state?: string,\n signInConfig?: Record<string, string | boolean>,\n ): Promise<TokenResponse> {\n if (!userId) {\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-SI-NF01',\n 'No user ID was provided.',\n 'Unable to sign in the user as no user ID was provided.',\n ),\n );\n }\n\n if (await this.isSignedIn(userId)) {\n const sessionData: SessionData = await this._storageManager.getSessionData(userId);\n\n return Promise.resolve({\n accessToken: sessionData.access_token,\n createdAt: sessionData.created_at,\n expiresIn: sessionData.expires_in,\n idToken: sessionData.id_token,\n refreshToken: sessionData.refresh_token ?? '',\n scope: sessionData.scope,\n tokenType: sessionData.token_type,\n });\n }\n\n //Check if the authorization code or session state is there.\n //If so, generate the access token, otherwise generate the auth URL and return with callback function.\n if (!authorizationCode || !state) {\n if (!authURLCallback || typeof authURLCallback !== 'function') {\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-SI-NF02',\n 'Invalid AuthURLCallback function.',\n 'The AuthURLCallback is not defined or is not a function.',\n ),\n );\n }\n const authURL = await this.getAuthURL(userId, signInConfig);\n authURLCallback(authURL);\n\n return Promise.resolve({\n accessToken: '',\n createdAt: 0,\n expiresIn: '',\n idToken: '',\n refreshToken: '',\n scope: '',\n session: '',\n tokenType: '',\n });\n }\n\n return this.requestAccessToken(authorizationCode, sessionState ?? '', userId, state);\n }\n\n public async getAuthURL(userId: string, signInConfig?: Record<string, string | boolean>): Promise<string> {\n const authURL = await this._auth.getSignInUrl(signInConfig, userId);\n\n if (authURL) {\n return Promise.resolve(authURL.toString());\n } else {\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-GAU-NF01',\n 'Getting Authorization URL failed.',\n 'No authorization URL was returned by the Asgardeo Auth JS SDK.',\n ),\n );\n }\n }\n\n public async requestAccessToken(\n authorizationCode: string,\n sessionState: string,\n userId: string,\n state: string,\n ): Promise<TokenResponse> {\n return this._auth.requestAccessToken(authorizationCode, sessionState, state, userId);\n }\n\n public async getIdToken(userId: string): Promise<string> {\n const is_logged_in = await this.isSignedIn(userId);\n if (!is_logged_in) {\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-GIT-NF01',\n 'The user is not logged in.',\n 'No session ID was found for the requested user. User is not logged in.',\n ),\n );\n }\n const idToken = await this._auth.getIdToken(userId);\n if (idToken) {\n return Promise.resolve(idToken);\n } else {\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-GIT-NF02',\n 'Requesting ID Token Failed',\n 'No ID Token was returned by the Asgardeo Auth JS SDK.',\n ),\n );\n }\n }\n\n public async refreshAccessToken(userId?: string): Promise<TokenResponse> {\n return this._auth.refreshAccessToken(userId);\n }\n\n public async isSignedIn(userId: string): Promise<boolean> {\n try {\n if (!(await this._auth.isSignedIn(userId))) {\n return Promise.resolve(false);\n }\n\n if (await SessionUtils.validateSession(await this._storageManager.getSessionData(userId))) {\n return Promise.resolve(true);\n }\n\n const refreshed_token = await this.refreshAccessToken(userId);\n\n if (refreshed_token) {\n return Promise.resolve(true);\n }\n\n this._storageManager.removeSessionData(userId);\n this._storageManager.getTemporaryData(userId);\n return Promise.resolve(false);\n } catch (error) {\n return Promise.reject(error);\n }\n }\n\n public async signOut(userId: string): Promise<string> {\n const signOutURL = await this._auth.getSignOutUrl(userId);\n\n if (!signOutURL) {\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-SO-NF01',\n 'Signing out the user failed.',\n 'Could not obtain the sign-out URL from the server.',\n ),\n );\n }\n\n return Promise.resolve(signOutURL);\n }\n\n public async getUser(userId: string): Promise<User> {\n return this._auth.getUser(userId);\n }\n\n public async getConfigData(): Promise<AuthClientConfig<T>> {\n return this._storageManager.getConfigData();\n }\n\n public async getOpenIDProviderEndpoints(): Promise<OIDCEndpoints> {\n return this._auth.getOpenIDProviderEndpoints() as Promise<OIDCEndpoints>;\n }\n\n public async getDecodedIdToken(userId?: string, idToken?: string): Promise<IdToken> {\n return this._auth.getDecodedIdToken(userId, idToken);\n }\n\n public async getAccessToken(userId?: string): Promise<string> {\n return this._auth.getAccessToken(userId);\n }\n\n public async exchangeToken(config: TokenExchangeRequestConfig, userId?: string): Promise<TokenResponse | Response> {\n return this._auth.exchangeToken(config, userId);\n }\n\n public async reInitialize(config: Partial<AuthClientConfig<T>>): Promise<void> {\n return this._auth.reInitialize(config);\n }\n\n public async revokeAccessToken(userId?: string): Promise<Response> {\n return this._auth.revokeAccessToken(userId);\n }\n\n public static didSignOutFail(afterSignOutUrl: string): boolean {\n return AsgardeoNodeCore.didSignOutFail(afterSignOutUrl);\n }\n\n public static isSignOutSuccessful(afterSignOutUrl: string): boolean {\n return AsgardeoNodeCore.isSignOutSuccessful(afterSignOutUrl);\n }\n\n public getStorageManager(): StorageManager<T> {\n return this._storageManager;\n }\n\n public async decodeJwtToken<K = Record<string, unknown>>(token: string): Promise<K> {\n return this._auth.decodeJwtToken<K>(token);\n }\n}\n", "/**\n * Copyright (c) 2022, WSO2 Inc. (http://www.wso2.com) All Rights Reserved.\n *\n * WSO2 Inc. 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 {Storage} from '@asgardeo/javascript';\nimport cache from 'memory-cache';\n\nexport class MemoryCacheStore implements Storage {\n public async setData(key: string, value: string): Promise<void> {\n cache.put(key, value);\n }\n\n public async getData(key: string): Promise<string> {\n return cache.get(key) ?? '{}';\n }\n\n public async removeData(key: string): Promise<void> {\n cache.del(key);\n }\n}\n", "/**\n* Copyright (c) 2022, WSO2 Inc. (http://www.wso2.com) All Rights Reserved.\n*\n* WSO2 Inc. 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 { validate as uuidValidate, version as uuidVersion, v4 as uuidv4 } from \"uuid\";\nimport { Logger } from \".\";\nimport { SessionData } from \"@asgardeo/javascript\";\nimport { NodeSessionData } from \"../models\";\nimport { UUID_VERSION } from \"../constants\";\n\nexport class SessionUtils {\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private constructor() { }\n\n public static createUUID(): string {\n const generated_uuid = uuidv4();\n return generated_uuid;\n }\n\n public static validateUUID(uuid: string): Promise<boolean> {\n if (uuidValidate(uuid) && uuidVersion(uuid) === UUID_VERSION) {\n return Promise.resolve(true)\n } else {\n return Promise.resolve(false);\n }\n }\n\n public static validateSession(sessionData: SessionData): Promise<boolean> {\n const currentTime = Date.now();\n const expiryTimeStamp : number = sessionData.created_at + parseInt(sessionData.expires_in) * 60 * 1000;\n //If the expiry time is greater than the current time, then the cookie is still valid\n if (currentTime < expiryTimeStamp) {\n return Promise.resolve(true);\n } else {\n Logger.warn(\"Expired Session\");\n\n return Promise.resolve(false);\n }\n }\n\n}\n", "/**\n * Copyright (c) 2022, WSO2 Inc. (http://www.wso2.com) All Rights Reserved.\n *\n * WSO2 Inc. 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 const UUID_VERSION = 4;\n", "/**\n * Copyright (c) 2022, WSO2 Inc. (http://www.wso2.com) All Rights Reserved.\n *\n * WSO2 Inc. 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 const LOGGER_CONFIG = {\n bgGreen: \"\\x1b[42m\",\n bgRed: \"\\x1b[41m\",\n bgWhite: \"\\x1b[47m\",\n bgYellow: \"\\x1b[43m\",\n fgBlack: \"\\x1b[30m\",\n fgGreen: \"\\x1b[32m\",\n fgRed: \"\\x1b[31m\",\n fgWhite: \"\\x1b[37m\",\n fgYellow: \"\\x1b[33m\",\n reset: \"\\x1b[0m\"\n}\n", "/**\n* Copyright (c) 2022, WSO2 Inc. (http://www.wso2.com) All Rights Reserved.\n*\n* WSO2 Inc. 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/* eslint-disable no-console */\n\nimport { LOGGER_CONFIG } from \"../constants\";\n\nenum LogLevel {\n DEBUG,\n INFO,\n WARN,\n ERROR,\n OFF\n}\n\nexport class Logger {\n static LOG_LEVEL = process.env[\"LOG_LEVEL\"] ?? LogLevel[LogLevel.OFF];\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private constructor() { }\n\n public static debug(message: string): void {\n if (LogLevel[this.LOG_LEVEL] <= LogLevel.DEBUG)\n console.log(\n LOGGER_CONFIG.bgGreen,\n LOGGER_CONFIG.fgBlack,\n \"DEBUG\",\n LOGGER_CONFIG.reset,\n LOGGER_CONFIG.fgGreen,\n message,\n LOGGER_CONFIG.reset\n );\n }\n\n public static info(message: string): void {\n if (LogLevel[this.LOG_LEVEL] <= LogLevel.INFO)\n console.log(\n LOGGER_CONFIG.bgWhite,\n LOGGER_CONFIG.fgBlack,\n \"INFO\",\n LOGGER_CONFIG.reset,\n LOGGER_CONFIG.fgWhite,\n message,\n LOGGER_CONFIG.reset\n );\n }\n\n public static warn(message: string): void {\n if (LogLevel[this.LOG_LEVEL] <= LogLevel.WARN)\n console.log(\n LOGGER_CONFIG.bgYellow,\n LOGGER_CONFIG.fgBlack,\n \"WARNING\",\n LOGGER_CONFIG.reset,\n LOGGER_CONFIG.fgYellow,\n message,\n LOGGER_CONFIG.reset\n );\n }\n\n public static error(message: string): void {\n if (LogLevel[this.LOG_LEVEL] <= LogLevel.ERROR)\n console.log(\n LOGGER_CONFIG.bgRed,\n LOGGER_CONFIG.fgBlack,\n \"ERROR\",\n LOGGER_CONFIG.reset,\n LOGGER_CONFIG.fgRed,\n message,\n LOGGER_CONFIG.reset\n );\n }\n}\n", "/**\n * Copyright (c) 2022, WSO2 Inc. (http://www.wso2.com) All Rights Reserved.\n *\n * WSO2 Inc. 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 {Crypto, JWKInterface} from '@asgardeo/javascript';\nimport base64url from 'base64url';\nimport sha256 from 'fast-sha256';\nimport * as jose from 'jose';\nimport randombytes from 'secure-random-bytes';\n\nexport class NodeCryptoUtils implements Crypto<Buffer | string> {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n public constructor() {}\n\n /**\n * Get URL encoded string.\n *\n * @returns {string} base 64 url encoded value.\n */\n public base64URLEncode(value: Buffer | string): string {\n return base64url.encode(value).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n }\n\n public base64URLDecode(value: string): string {\n return base64url.decode(value).toString();\n }\n\n public hashSha256(data: string): string | Buffer {\n return Buffer.from(sha256(new TextEncoder().encode(data)));\n }\n\n public generateRandomBytes(length: number): string | Buffer {\n return randombytes(length);\n }\n\n public async verifyJwt(\n idToken: string,\n jwk: Partial<JWKInterface>,\n algorithms: string[],\n clientId: string,\n issuer: string,\n subject: string,\n clockTolerance?: number,\n ): Promise<boolean> {\n const key = await jose.importJWK(jwk);\n return jose\n .jwtVerify(idToken, key, {\n algorithms: algorithms,\n audience: clientId,\n clockTolerance: clockTolerance,\n issuer: issuer,\n subject: subject,\n })\n .then(() => {\n return Promise.resolve(true);\n });\n }\n}\n", "/**\n * Copyright (c) {{year}}, 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 {\n AuthClientConfig,\n TokenExchangeRequestConfig,\n StorageManager,\n IdToken,\n OIDCEndpoints,\n Storage,\n TokenResponse,\n User,\n ExtendedAuthorizeRequestUrlParams,\n} from '@asgardeo/javascript';\nimport {AsgardeoNodeCore} from './core';\nimport {AuthURLCallback} from './models';\n\n/**\n * This class provides the necessary methods needed to implement authentication.\n *\n * @export\n * @class AsgardeoNodeClient\n */\nexport class AsgardeoNodeClient<T> {\n private _authCore: AsgardeoNodeCore<T>;\n\n /**\n * This is the constructor method that returns an instance of the `AsgardeoNodeClient` class.\n *\n * @param {AuthClientConfig<T>} config - The configuration object.\n * @param {Storage} store - The store object.\n *\n * @example\n * ```\n * const _store: Storage = new DataStore();\n * const _config = {\n afterSignInUrl: \"http://localhost:3000/sign-in\",\n afterSignOutUrl: \"http://localhost:3000/dashboard\",\n clientId: \"client ID\",\n serverOrigin: \"https://api.asgardeo.io/t/<org_name>\"\n };\n * const auth = new AsgardeoNodeClient(_config,_store);\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#constructor\n * @preserve\n */\n constructor() {}\n\n public async initialize(config: AuthClientConfig<T>, store?: Storage): Promise<boolean> {\n this._authCore = new AsgardeoNodeCore(config, store);\n\n return Promise.resolve(true);\n }\n\n /**\n * This method logs in a user. If the authorization code is not available it will resolve with the\n * authorization URL to authorize the user.\n * @param {string} authorizationCode - The authorization code obtained from Asgardeo after a user signs in.\n * @param {String} sessionState - The session state obtained from Asgardeo after a user signs in.\n * @param {string} 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 {string} state - The state parameter in the redirect URL.\n *\n * @return {Promise<URLResponse | NodeTokenResponse>} - A Promise that resolves with the\n * [`URLResponse`](#URLResponse) object or a Promise that resolves with\n * the [`NodeTokenResponse`](#NodeTokenResponse) object.\n *\n * @example\n * ```\n * authClient.signIn(req.query.code, req.query.session_state).then(response => {\n * //URL property will available if the user has not been authenticated already\n * if (response.hasOwnProperty('url')) {\n * res.redirect(response.url)\n * } else {\n * //Set the cookie\n * res.cookie('ASGARDEO_SESSION_ID', response.session, { maxAge: 900000, httpOnly: true, SameSite: true });\n * res.status(200).send(response)\n * }\n *});\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#signIn\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async signIn(\n authURLCallback: AuthURLCallback,\n userId: string,\n authorizationCode?: string,\n sessionState?: string,\n state?: string,\n signInConfig?: Record<string, string | boolean>,\n ): Promise<TokenResponse> {\n return this._authCore.signIn(authURLCallback, userId, authorizationCode, sessionState, state, signInConfig);\n }\n\n /**\n * Method to get the configuration data.\n *\n * @returns {Promise<AuthClientConfig<Config>>} - A promise that resolves with the configuration data.\n */\n public async getConfigData(): Promise<AuthClientConfig<T>> {\n return this._authCore.getConfigData();\n }\n\n /**\n * This method clears all session data and returns the sign-out URL.\n * @param {string} userId - The userId of the user. (If you are using ExpressJS,\n * you may get this from the request cookies)\n *\n * @return {Promise<string>} - A Promise that resolves with the sign-out URL.\n *\n * @example\n * ```\n * const signOutUrl = await auth.signOut(userId);\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#signOut\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async signOut(userId: string): Promise<string> {\n return this._authCore.signOut(userId);\n }\n\n /**\n * This method returns a boolean value indicating if the user is authenticated or not.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return { Promise<boolean>} -A boolean value that indicates of the user is authenticated or not.\n *\n * @example\n * ```\n * const isAuth = await authClient.isSignedIn(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#isSignedIn\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async isSignedIn(userId: string): Promise<boolean> {\n return this._authCore.isSignedIn(userId);\n }\n\n /**\n * This method returns the id token.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<string>} -A Promise that resolves with the ID Token.\n *\n * @example\n * ```\n * const isAuth = await authClient.getIdToken(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getIdToken\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async getIdToken(userId: string): Promise<string> {\n return this._authCore.getIdToken(userId);\n }\n\n /**\n * This method returns an object containing basic user information obtained from the id token.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<string>} -A Promise that resolves with the\n * An object containing basic user information obtained from the id token.\n *\n * @example\n * ```\n * const basicInfo = await authClient.getUser(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getUser\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async getUser(userId: string): Promise<User> {\n return this._authCore.getUser(userId);\n }\n\n /**\n * This method returns an object containing the OIDC service endpoints returned by the `.well-known` endpoint.\n * @return {Promise<OIDCEndpoints>} -A Promise that resolves with\n * an object containing the OIDC service endpoints returned by the `.well-known` endpoint.\n *\n * @example\n * ```\n * const oidcEndpoints = await auth.getOpenIDProviderEndpoints();\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getOpenIDProviderEndpoints\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async getOpenIDProviderEndpoints(): Promise<OIDCEndpoints> {\n return this._authCore.getOpenIDProviderEndpoints();\n }\n\n /**\n * This method returns the decoded ID token payload.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<IdToken>} -A Promise that resolves with\n * an object containing the decoded ID token payload.\n *\n * @example\n * ```\n * const decodedIDTokenPayload = await auth.getDecodedIdToken(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getDecodedIdToken\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async getDecodedIdToken(userId?: string, idToken?: string): Promise<IdToken> {\n return this._authCore.getDecodedIdToken(userId, idToken);\n }\n\n /**\n * This method returns the access token.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<string>} -A Promise that resolves with\n * the access token stored in the store\n *\n * @example\n * ```\n *const accessToken = await auth.getAccessToken(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getAccessToken\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async getAccessToken(userId?: string): Promise<string> {\n return this._authCore.getAccessToken(userId);\n }\n\n /**\n * This method returns Promise that resolves with the token information\n * or the response returned by the server depending on the configuration passed.\n * @param {TokenExchangeRequestConfig} config - The config object contains attributes that would be used\n * to configure the custom grant request.\n *\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<TokenResponse | Response>} -A Promise that resolves with the token information\n * or the response returned by the server depending on the configuration passed.\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.exchangeToken(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#exchangeToken\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async exchangeToken(config: TokenExchangeRequestConfig, userId?: string): Promise<TokenResponse | Response> {\n return this._authCore.exchangeToken(config, userId);\n }\n\n /**\n * This method can be used to update the configurations passed into the constructor of the AsgardeoAuthClient.\n * @param {AuthClientConfig<T>} config - The config object containing the attributes\n * that can be used to configure the SDK\n *\n * @return {Promise<void>} -A Promise that resolves with a void.\n *\n * @example\n * ```\n * const reInitialize = await auth.reInitialize({\n * afterSignOutUrl: \"http://localhost:3000/sign-out\"\n * });\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#reInitialize\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async reInitialize(config: Partial<AuthClientConfig<T>>): Promise<void> {\n return this._authCore.reInitialize(config);\n }\n\n public async getSignInUrl(requestConfig?: ExtendedAuthorizeRequestUrlParams, userId?: string): Promise<string> {\n return this._authCore.getAuthURL(userId, requestConfig);\n }\n\n /**\n * This method returns a Promise that resolves with the response returned by the server.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<Response>} -A Promise that resolves with the response returned by the server.\n *\n * @example\n * ```\n * const revokeToken = await auth.revokeAccessToken(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#revokeAccessToken\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async revokeAccessToken(userId?: string): Promise<Response> {\n return this._authCore.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 {string} userId - 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 {Promise<TokenResponse>} - A Promise that resolves with the token response.\n *\n * @example\n * ```\n * const tokenResponse = await auth.refreshAccessToken(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\")\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#refreshAccessToken\n *\n * @memberof AsgardeoNodeClient\n */\n public refreshAccessToken(userId?: string): Promise<TokenResponse> {\n return this._authCore.refreshAccessToken(userId);\n }\n\n /**\n * This method returns if the user has been successfully signed out or not.\n * @param {string} afterSignOutUrl - The URL to which the user is redirected to\n * after signing out from the server.\n *\n * @return {boolean} - A boolean value indicating if the user has been signed out or not.\n *\n * @example\n * ```\n * const isSignedOut = auth.isSignOutSuccessful(<signout_url>);;\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#isSignOutSuccessful\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public static isSignOutSuccessful(afterSignOutUrl: string): boolean {\n return AsgardeoNodeClient.isSignOutSuccessful(afterSignOutUrl);\n }\n\n /**\n * This method returns if sign-out failed or not\n * @param {string} afterSignOutUrl - The URL to which the user is redirected to\n * after signing out from the server.\n *\n * @return {boolean} - A boolean value indicating if sign-out failed or not.\n *\n * @example\n * ```\n * const isSignedOut = auth.isSignOutSuccessful(<signout_url>);\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#didSignOutFail\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public static didSignOutFail(afterSignOutUrl: string): boolean {\n return AsgardeoNodeClient.didSignOutFail(afterSignOutUrl);\n }\n\n public async getStorageManager(): Promise<StorageManager<T>> {\n return this._authCore.getStorageManager();\n }\n\n public async decodeJwtToken<K = Record<string, unknown>>(token: string): Promise<K> {\n return this._authCore.decodeJwtToken<K>(token);\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 {VendorConstants} from '@asgardeo/javascript';\n\nclass CookieConfig {\n static readonly SESSION_COOKIE_NAME: string = `__${VendorConstants.VENDOR_PREFIX}__session`;\n\n static readonly TEMP_SESSION_COOKIE_NAME: string = `__${VendorConstants.VENDOR_PREFIX}__temp.session`;\n\n static readonly DEFAULT_MAX_AGE: number = 3600;\n\n static readonly DEFAULT_HTTP_ONLY: boolean = true;\n\n static readonly DEFAULT_SAME_SITE: 'lax' | 'strict' | 'none' = 'lax';\n\n static readonly DEFAULT_SECURE: boolean = true;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private constructor() {}\n}\n\nexport default CookieConfig;\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\nconst generateSessionId = (): string => new Date().getTime().toString(36) + Math.random().toString(36).substring(2);\n\nexport default generateSessionId;\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 CookieConfig from '../constants/CookieConfig';\nimport {CookieOptions} from '../models/cookies';\n\n/**\n * Creates a complete set of cookie options by merging provided options with defaults\n *\n * @param options - Partial cookie options to override defaults\n *\n * @returns Complete cookie options with all required fields\n *\n * @example\n * ```ts\n * // Use defaults with only maxAge override\n * const options = getSessionCookieOptions({ maxAge: 3600 });\n *\n * // Override multiple defaults\n * const options = getSessionCookieOptions({\n * maxAge: 3600,\n * secure: true,\n * sameSite: 'strict'\n * });\n * ```\n */\nconst getSessionCookieOptions = (options: Partial<CookieOptions>): CookieOptions => ({\n ...options,\n httpOnly: options.httpOnly ?? CookieConfig.DEFAULT_HTTP_ONLY,\n maxAge: options.maxAge ?? CookieConfig.DEFAULT_MAX_AGE,\n sameSite: options.sameSite ?? CookieConfig.DEFAULT_SAME_SITE,\n secure: options.secure ?? CookieConfig.DEFAULT_SECURE,\n});\n\nexport default getSessionCookieOptions;\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 {AsgardeoJavaScriptClient} from '@asgardeo/javascript';\nimport {AsgardeoNodeConfig} from './models/config';\n\n/**\n * Base class for implementing Asgardeo in Node.js based applications.\n * This class provides the core functionality for managing user authentication and sessions.\n *getConfigData\n * @typeParam T - Configuration type that extends AsgardeoNodeConfig.\n */\nabstract class AsgardeoNodeClient<T = AsgardeoNodeConfig> extends AsgardeoJavaScriptClient<T> {}\n\nexport default AsgardeoNodeClient;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA,yBAAkD;;;ACDlD,wBAaO;;;ACZP,0BAAkB;AAEX,IAAM,mBAAN,MAA0C;AAAA,EAC/C,MAAa,QAAQ,KAAa,OAA8B;AAC9D,wBAAAA,QAAM,IAAI,KAAK,KAAK;AAAA,EACtB;AAAA,EAEA,MAAa,QAAQ,KAA8B;AACjD,WAAO,oBAAAA,QAAM,IAAI,GAAG,KAAK;AAAA,EAC3B;AAAA,EAEA,MAAa,WAAW,KAA4B;AAClD,wBAAAA,QAAM,IAAI,GAAG;AAAA,EACf;AACF;;;ACfA,kBAA+E;;;ACAxE,IAAM,eAAe;;;ACArB,IAAM,gBAAgB;AAAA,EACzB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,SAAS;AAAA,EACT,UAAU;AAAA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Aa;AAAA,EAC3C,QAAQ,QAAQ,UAAU,qBAAa;AAAA,EACvC,UAAU,QAAQ,YAAY,qBAAa;AAAA,EAC3C,QAAQ,QAAQ,UAAU,qBAAa;AACzC;AAEA,IAAO,kCAAQ;;;AC/Bf,IAAAC,qBAAuC;AASvC,IAAeC,sBAAf,cAAkE,4CAA4B;AAAC;AAE/F,IAAO,6BAAQA;;;AZaf,0BAAc,iCA1Cd;AAqBA,IAAI,CAAC,WAAW,OAAO;AACnB,aAAW,QAAQ,mBAAAC;AACnB,aAAW,UAAU;AACrB,aAAW,UAAU;AACrB,aAAW,WAAW;AAC1B;",
4
+ "sourcesContent": ["/**\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// Add Ponyfills for Fetch API\nimport fetch, {Headers, Request, Response} from 'cross-fetch';\n\nif (!globalThis.fetch) {\n globalThis.fetch = fetch;\n globalThis.Headers = Headers;\n globalThis.Request = Request;\n globalThis.Response = Response;\n}\n\nexport {AsgardeoNodeClient as LegacyAsgardeoNodeClient} from './__legacy__/client';\nexport * from './__legacy__/models';\nexport * from './__legacy__/utils/logger-utils';\n\nexport {default as CookieConfig} from './constants/CookieConfig';\n\nexport {AsgardeoNodeConfig} from './models/config';\nexport {CookieOptions} from './models/cookies';\n\nexport {default as generateSessionId} from './utils/generateSessionId';\nexport {default as getSessionCookieOptions} from './utils/getSessionCookieOptions';\n\nexport {default as AsgardeoNodeClient} from './AsgardeoNodeClient';\n\nexport * from '@asgardeo/javascript';\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 {\n AsgardeoAuthClient,\n AsgardeoAuthException,\n AuthClientConfig,\n Crypto,\n TokenExchangeRequestConfig,\n StorageManager,\n IdToken,\n OIDCEndpoints,\n SessionData,\n Storage,\n TokenResponse,\n User,\n} from '@asgardeo/javascript';\nimport {AuthURLCallback} from '../models';\nimport {MemoryCacheStore} from '../stores';\nimport {Logger, SessionUtils} from '../utils';\nimport {NodeCryptoUtils} from '../utils/crypto-utils';\n\nexport class AsgardeoNodeCore<T> {\n private auth: AsgardeoAuthClient<T>;\n\n private cryptoUtils: Crypto;\n\n private store: Storage;\n\n private storageManager: StorageManager<T>;\n\n constructor(config: AuthClientConfig<T>, store?: Storage) {\n // Initialize the default memory cache store if an external store is not passed.\n if (!store) {\n this.store = new MemoryCacheStore();\n } else {\n this.store = store;\n }\n this.cryptoUtils = new NodeCryptoUtils();\n this.auth = new AsgardeoAuthClient();\n this.auth.initialize(config, this.store, this.cryptoUtils);\n this.storageManager = this.auth.getStorageManager();\n Logger.debug('Initialized AsgardeoAuthClient successfully');\n }\n\n public async signIn(\n authURLCallback: AuthURLCallback,\n userId: string,\n authorizationCode?: string,\n sessionState?: string,\n state?: string,\n signInConfig?: Record<string, string | boolean>,\n ): Promise<TokenResponse> {\n if (!userId) {\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-SI-NF01',\n 'No user ID was provided.',\n 'Unable to sign in the user as no user ID was provided.',\n ),\n );\n }\n\n if (await this.isSignedIn(userId)) {\n const sessionData: SessionData = await this.storageManager.getSessionData(userId);\n\n return Promise.resolve({\n accessToken: sessionData.access_token,\n createdAt: sessionData.created_at,\n expiresIn: sessionData.expires_in,\n idToken: sessionData.id_token,\n refreshToken: sessionData.refresh_token ?? '',\n scope: sessionData.scope,\n tokenType: sessionData.token_type,\n });\n }\n\n // Check if the authorization code or session state is there.\n // If so, generate the access token, otherwise generate the auth URL and return with callback function.\n if (!authorizationCode || !state) {\n if (!authURLCallback || typeof authURLCallback !== 'function') {\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-SI-NF02',\n 'Invalid AuthURLCallback function.',\n 'The AuthURLCallback is not defined or is not a function.',\n ),\n );\n }\n const authURL: string = await this.getAuthURL(userId, signInConfig);\n authURLCallback(authURL);\n\n return Promise.resolve({\n accessToken: '',\n createdAt: 0,\n expiresIn: '',\n idToken: '',\n refreshToken: '',\n scope: '',\n session: '',\n tokenType: '',\n });\n }\n\n return this.requestAccessToken(authorizationCode, sessionState ?? '', userId, state);\n }\n\n public async getAuthURL(userId: string, signInConfig?: Record<string, string | boolean>): Promise<string> {\n const authURL: string | undefined = await this.auth.getSignInUrl(signInConfig, userId);\n\n if (authURL) {\n return Promise.resolve(authURL.toString());\n }\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-GAU-NF01',\n 'Getting Authorization URL failed.',\n 'No authorization URL was returned by the Asgardeo Auth JS SDK.',\n ),\n );\n }\n\n public async requestAccessToken(\n authorizationCode: string,\n sessionState: string,\n userId: string,\n state: string,\n ): Promise<TokenResponse> {\n return this.auth.requestAccessToken(authorizationCode, sessionState, state, userId);\n }\n\n public async getIdToken(userId: string): Promise<string> {\n const isLoggedIn: boolean = await this.isSignedIn(userId);\n if (!isLoggedIn) {\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-GIT-NF01',\n 'The user is not logged in.',\n 'No session ID was found for the requested user. User is not logged in.',\n ),\n );\n }\n const idToken: string = await this.auth.getIdToken(userId);\n if (idToken) {\n return Promise.resolve(idToken);\n }\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-GIT-NF02',\n 'Requesting ID Token Failed',\n 'No ID Token was returned by the Asgardeo Auth JS SDK.',\n ),\n );\n }\n\n public async refreshAccessToken(userId?: string): Promise<TokenResponse> {\n return this.auth.refreshAccessToken(userId);\n }\n\n public async isSignedIn(userId: string): Promise<boolean> {\n try {\n if (!(await this.auth.isSignedIn(userId))) {\n return Promise.resolve(false);\n }\n\n if (await SessionUtils.validateSession(await this.storageManager.getSessionData(userId))) {\n return Promise.resolve(true);\n }\n\n const refreshedToken: TokenResponse = await this.refreshAccessToken(userId);\n\n if (refreshedToken) {\n return Promise.resolve(true);\n }\n\n this.storageManager.removeSessionData(userId);\n this.storageManager.getTemporaryData(userId);\n return Promise.resolve(false);\n } catch (error) {\n return Promise.reject(error);\n }\n }\n\n public async signOut(userId: string): Promise<string> {\n const signOutURL: string = await this.auth.getSignOutUrl(userId);\n\n if (!signOutURL) {\n return Promise.reject(\n new AsgardeoAuthException(\n 'NODE-AUTH_CORE-SO-NF01',\n 'Signing out the user failed.',\n 'Could not obtain the sign-out URL from the server.',\n ),\n );\n }\n\n return Promise.resolve(signOutURL);\n }\n\n public async getUser(userId: string): Promise<User> {\n return this.auth.getUser(userId);\n }\n\n public async getConfigData(): Promise<AuthClientConfig<T>> {\n return this.storageManager.getConfigData();\n }\n\n public async getOpenIDProviderEndpoints(): Promise<OIDCEndpoints> {\n return this.auth.getOpenIDProviderEndpoints() as Promise<OIDCEndpoints>;\n }\n\n public async getDecodedIdToken(userId?: string, idToken?: string): Promise<IdToken> {\n return this.auth.getDecodedIdToken(userId, idToken);\n }\n\n public async getAccessToken(userId?: string): Promise<string> {\n return this.auth.getAccessToken(userId);\n }\n\n public async exchangeToken(config: TokenExchangeRequestConfig, userId?: string): Promise<TokenResponse | Response> {\n return this.auth.exchangeToken(config, userId);\n }\n\n public async reInitialize(config: Partial<AuthClientConfig<T>>): Promise<void> {\n return this.auth.reInitialize(config);\n }\n\n public async revokeAccessToken(userId?: string): Promise<Response> {\n return this.auth.revokeAccessToken(userId);\n }\n\n public static didSignOutFail(afterSignOutUrl: string): boolean {\n return AsgardeoNodeCore.didSignOutFail(afterSignOutUrl);\n }\n\n public static isSignOutSuccessful(afterSignOutUrl: string): boolean {\n return AsgardeoNodeCore.isSignOutSuccessful(afterSignOutUrl);\n }\n\n public getStorageManager(): StorageManager<T> {\n return this.storageManager;\n }\n\n public async decodeJwtToken<K = Record<string, unknown>>(token: string): Promise<K> {\n return this.auth.decodeJwtToken<K>(token);\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 {Storage} from '@asgardeo/javascript';\nimport cache from 'memory-cache';\n\nexport class MemoryCacheStore implements Storage {\n // eslint-disable-next-line class-methods-use-this\n public async setData(key: string, value: string): Promise<void> {\n cache.put(key, value);\n }\n\n // eslint-disable-next-line class-methods-use-this\n public async getData(key: string): Promise<string> {\n return cache.get(key) ?? '{}';\n }\n\n // eslint-disable-next-line class-methods-use-this\n public async removeData(key: string): Promise<void> {\n cache.del(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\nimport {SessionData} from '@asgardeo/javascript';\nimport {validate as uuidValidate, version as uuidVersion, v4 as uuidv4} from 'uuid';\n// eslint-disable-next-line import/no-cycle\nimport {Logger} from '.';\nimport {UUID_VERSION} from '../constants';\n\nexport class SessionUtils {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private constructor() {}\n\n public static createUUID(): string {\n const generatedUuid: string = uuidv4();\n return generatedUuid;\n }\n\n public static validateUUID(uuid: string): Promise<boolean> {\n if (uuidValidate(uuid) && uuidVersion(uuid) === UUID_VERSION) {\n return Promise.resolve(true);\n }\n return Promise.resolve(false);\n }\n\n public static validateSession(sessionData: SessionData): Promise<boolean> {\n const currentTime: number = Date.now();\n const expiryTimeStamp: number = sessionData.created_at + parseInt(sessionData.expires_in, 10) * 60 * 1000;\n // If the expiry time is greater than the current time, then the cookie is still valid\n if (currentTime < expiryTimeStamp) {\n return Promise.resolve(true);\n }\n Logger.warn('Expired Session');\n\n return Promise.resolve(false);\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 const UUID_VERSION: number = 4;\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\ninterface LoggerConfig {\n bgGreen: string;\n bgRed: string;\n bgWhite: string;\n bgYellow: string;\n fgBlack: string;\n fgGreen: string;\n fgRed: string;\n fgWhite: string;\n fgYellow: string;\n reset: string;\n}\n\nexport const LOGGER_CONFIG: LoggerConfig = {\n bgGreen: '\\x1b[42m',\n bgRed: '\\x1b[41m',\n bgWhite: '\\x1b[47m',\n bgYellow: '\\x1b[43m',\n fgBlack: '\\x1b[30m',\n fgGreen: '\\x1b[32m',\n fgRed: '\\x1b[31m',\n fgWhite: '\\x1b[37m',\n fgYellow: '\\x1b[33m',\n reset: '\\x1b[0m',\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/* eslint-disable no-console */\n\nimport {LOGGER_CONFIG} from '../constants';\n\nenum LogLevel {\n DEBUG,\n INFO,\n WARN,\n ERROR,\n OFF,\n}\n\nexport class Logger {\n static LOG_LEVEL: string = process.env['LOG_LEVEL'] ?? LogLevel[LogLevel.OFF];\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private constructor() {}\n\n public static debug(message: string): void {\n if (LogLevel[this.LOG_LEVEL] <= LogLevel.DEBUG)\n console.log(\n LOGGER_CONFIG.bgGreen,\n LOGGER_CONFIG.fgBlack,\n 'DEBUG',\n LOGGER_CONFIG.reset,\n LOGGER_CONFIG.fgGreen,\n message,\n LOGGER_CONFIG.reset,\n );\n }\n\n public static info(message: string): void {\n if (LogLevel[this.LOG_LEVEL] <= LogLevel.INFO)\n console.log(\n LOGGER_CONFIG.bgWhite,\n LOGGER_CONFIG.fgBlack,\n 'INFO',\n LOGGER_CONFIG.reset,\n LOGGER_CONFIG.fgWhite,\n message,\n LOGGER_CONFIG.reset,\n );\n }\n\n public static warn(message: string): void {\n if (LogLevel[this.LOG_LEVEL] <= LogLevel.WARN)\n console.log(\n LOGGER_CONFIG.bgYellow,\n LOGGER_CONFIG.fgBlack,\n 'WARNING',\n LOGGER_CONFIG.reset,\n LOGGER_CONFIG.fgYellow,\n message,\n LOGGER_CONFIG.reset,\n );\n }\n\n public static error(message: string): void {\n if (LogLevel[this.LOG_LEVEL] <= LogLevel.ERROR)\n console.log(\n LOGGER_CONFIG.bgRed,\n LOGGER_CONFIG.fgBlack,\n 'ERROR',\n LOGGER_CONFIG.reset,\n LOGGER_CONFIG.fgRed,\n message,\n LOGGER_CONFIG.reset,\n );\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 {Crypto, JWKInterface} from '@asgardeo/javascript';\nimport base64url from 'base64url';\nimport sha256 from 'fast-sha256';\nimport * as jose from 'jose';\nimport randombytes from 'secure-random-bytes';\n\nexport class NodeCryptoUtils implements Crypto<Buffer | string> {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n public constructor() {}\n\n /**\n * Get URL encoded string.\n *\n * @returns {string} base 64 url encoded value.\n */\n // eslint-disable-next-line class-methods-use-this\n public base64URLEncode(value: Buffer | string): string {\n return base64url.encode(value).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n }\n\n // eslint-disable-next-line class-methods-use-this\n public base64URLDecode(value: string): string {\n return base64url.decode(value).toString();\n }\n\n // eslint-disable-next-line class-methods-use-this\n public hashSha256(data: string): string | Buffer {\n return Buffer.from(sha256(new TextEncoder().encode(data)));\n }\n\n // eslint-disable-next-line class-methods-use-this\n public generateRandomBytes(length: number): string | Buffer {\n return randombytes(length);\n }\n\n // eslint-disable-next-line class-methods-use-this\n public async verifyJwt(\n idToken: string,\n jwk: Partial<JWKInterface>,\n algorithms: string[],\n clientId: string,\n issuer: string,\n subject: string,\n clockTolerance?: number,\n ): Promise<boolean> {\n const key: jose.CryptoKey | Uint8Array = await jose.importJWK(jwk);\n return jose\n .jwtVerify(idToken, key, {\n algorithms,\n audience: clientId,\n clockTolerance,\n issuer,\n subject,\n })\n .then(() => Promise.resolve(true));\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 {\n AuthClientConfig,\n TokenExchangeRequestConfig,\n StorageManager,\n IdToken,\n OIDCEndpoints,\n Storage,\n TokenResponse,\n User,\n ExtendedAuthorizeRequestUrlParams,\n} from '@asgardeo/javascript';\nimport {AsgardeoNodeCore} from './core';\nimport {AuthURLCallback} from './models';\n\n/**\n * This class provides the necessary methods needed to implement authentication.\n *\n * @export\n * @class AsgardeoNodeClient\n */\nexport class AsgardeoNodeClient<T> {\n private authCore: AsgardeoNodeCore<T>;\n\n /**\n * This is the constructor method that returns an instance of the `AsgardeoNodeClient` class.\n *\n * @param {AuthClientConfig<T>} config - The configuration object.\n * @param {Storage} store - The store object.\n *\n * @example\n * ```\n * const _store: Storage = new DataStore();\n * const _config = {\n afterSignInUrl: \"http://localhost:3000/sign-in\",\n afterSignOutUrl: \"http://localhost:3000/dashboard\",\n clientId: \"client ID\",\n serverOrigin: \"https://api.asgardeo.io/t/<org_name>\"\n };\n * const auth = new AsgardeoNodeClient(_config,_store);\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#constructor\n * @preserve\n */\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n constructor() {}\n\n public async initialize(config: AuthClientConfig<T>, store?: Storage): Promise<boolean> {\n this.authCore = new AsgardeoNodeCore(config, store);\n\n return Promise.resolve(true);\n }\n\n /**\n * This method logs in a user. If the authorization code is not available it will resolve with the\n * authorization URL to authorize the user.\n * @param {string} authorizationCode - The authorization code obtained from Asgardeo after a user signs in.\n * @param {String} sessionState - The session state obtained from Asgardeo after a user signs in.\n * @param {string} 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 {string} state - The state parameter in the redirect URL.\n *\n * @return {Promise<URLResponse | NodeTokenResponse>} - A Promise that resolves with the\n * [`URLResponse`](#URLResponse) object or a Promise that resolves with\n * the [`NodeTokenResponse`](#NodeTokenResponse) object.\n *\n * @example\n * ```\n * authClient.signIn(req.query.code, req.query.session_state).then(response => {\n * //URL property will available if the user has not been authenticated already\n * if (response.hasOwnProperty('url')) {\n * res.redirect(response.url)\n * } else {\n * //Set the cookie\n * res.cookie('ASGARDEO_SESSION_ID', response.session, { maxAge: 900000, httpOnly: true, SameSite: true });\n * res.status(200).send(response)\n * }\n *});\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#signIn\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async signIn(\n authURLCallback: AuthURLCallback,\n userId: string,\n authorizationCode?: string,\n sessionState?: string,\n state?: string,\n signInConfig?: Record<string, string | boolean>,\n ): Promise<TokenResponse> {\n return this.authCore.signIn(authURLCallback, userId, authorizationCode, sessionState, state, signInConfig);\n }\n\n /**\n * Method to get the configuration data.\n *\n * @returns {Promise<AuthClientConfig<Config>>} - A promise that resolves with the configuration data.\n */\n public async getConfigData(): Promise<AuthClientConfig<T>> {\n return this.authCore.getConfigData();\n }\n\n /**\n * This method clears all session data and returns the sign-out URL.\n * @param {string} userId - The userId of the user. (If you are using ExpressJS,\n * you may get this from the request cookies)\n *\n * @return {Promise<string>} - A Promise that resolves with the sign-out URL.\n *\n * @example\n * ```\n * const signOutUrl = await auth.signOut(userId);\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#signOut\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async signOut(userId: string): Promise<string> {\n return this.authCore.signOut(userId);\n }\n\n /**\n * This method returns a boolean value indicating if the user is authenticated or not.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return { Promise<boolean>} -A boolean value that indicates of the user is authenticated or not.\n *\n * @example\n * ```\n * const isAuth = await authClient.isSignedIn(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#isSignedIn\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async isSignedIn(userId: string): Promise<boolean> {\n return this.authCore.isSignedIn(userId);\n }\n\n /**\n * This method returns the id token.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<string>} -A Promise that resolves with the ID Token.\n *\n * @example\n * ```\n * const isAuth = await authClient.getIdToken(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getIdToken\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async getIdToken(userId: string): Promise<string> {\n return this.authCore.getIdToken(userId);\n }\n\n /**\n * This method returns an object containing basic user information obtained from the id token.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<string>} -A Promise that resolves with the\n * An object containing basic user information obtained from the id token.\n *\n * @example\n * ```\n * const basicInfo = await authClient.getUser(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getUser\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async getUser(userId: string): Promise<User> {\n return this.authCore.getUser(userId);\n }\n\n /**\n * This method returns an object containing the OIDC service endpoints returned by the `.well-known` endpoint.\n * @return {Promise<OIDCEndpoints>} -A Promise that resolves with\n * an object containing the OIDC service endpoints returned by the `.well-known` endpoint.\n *\n * @example\n * ```\n * const oidcEndpoints = await auth.getOpenIDProviderEndpoints();\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getOpenIDProviderEndpoints\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async getOpenIDProviderEndpoints(): Promise<OIDCEndpoints> {\n return this.authCore.getOpenIDProviderEndpoints();\n }\n\n /**\n * This method returns the decoded ID token payload.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<IdToken>} -A Promise that resolves with\n * an object containing the decoded ID token payload.\n *\n * @example\n * ```\n * const decodedIDTokenPayload = await auth.getDecodedIdToken(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getDecodedIdToken\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async getDecodedIdToken(userId?: string, idToken?: string): Promise<IdToken> {\n return this.authCore.getDecodedIdToken(userId, idToken);\n }\n\n /**\n * This method returns the access token.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<string>} -A Promise that resolves with\n * the access token stored in the store\n *\n * @example\n * ```\n *const accessToken = await auth.getAccessToken(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#getAccessToken\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async getAccessToken(userId?: string): Promise<string> {\n return this.authCore.getAccessToken(userId);\n }\n\n /**\n * This method returns Promise that resolves with the token information\n * or the response returned by the server depending on the configuration passed.\n * @param {TokenExchangeRequestConfig} config - The config object contains attributes that would be used\n * to configure the custom grant request.\n *\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<TokenResponse | Response>} -A Promise that resolves with the token information\n * or the response returned by the server depending on the configuration passed.\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.exchangeToken(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#exchangeToken\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async exchangeToken(config: TokenExchangeRequestConfig, userId?: string): Promise<TokenResponse | Response> {\n return this.authCore.exchangeToken(config, userId);\n }\n\n /**\n * This method can be used to update the configurations passed into the constructor of the AsgardeoAuthClient.\n * @param {AuthClientConfig<T>} config - The config object containing the attributes\n * that can be used to configure the SDK\n *\n * @return {Promise<void>} -A Promise that resolves with a void.\n *\n * @example\n * ```\n * const reInitialize = await auth.reInitialize({\n * afterSignOutUrl: \"http://localhost:3000/sign-out\"\n * });\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#reInitialize\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async reInitialize(config: Partial<AuthClientConfig<T>>): Promise<void> {\n return this.authCore.reInitialize(config);\n }\n\n public async getSignInUrl(requestConfig?: ExtendedAuthorizeRequestUrlParams, userId?: string): Promise<string> {\n return this.authCore.getAuthURL(userId, requestConfig);\n }\n\n /**\n * This method returns a Promise that resolves with the response returned by the server.\n * @param {string} userId - The userId of the user.\n * (If you are using ExpressJS, you may get this from the request cookies)\n *\n * @return {Promise<Response>} -A Promise that resolves with the response returned by the server.\n *\n * @example\n * ```\n * const revokeToken = await auth.revokeAccessToken(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\");\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#revokeAccessToken\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public async revokeAccessToken(userId?: string): Promise<Response> {\n return this.authCore.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 {string} userId - 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 {Promise<TokenResponse>} - A Promise that resolves with the token response.\n *\n * @example\n * ```\n * const tokenResponse = await auth.refreshAccessToken(\"a2a2972c-51cd-5e9d-a9ae-058fae9f7927\")\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#refreshAccessToken\n *\n * @memberof AsgardeoNodeClient\n */\n public refreshAccessToken(userId?: string): Promise<TokenResponse> {\n return this.authCore.refreshAccessToken(userId);\n }\n\n /**\n * This method returns if the user has been successfully signed out or not.\n * @param {string} afterSignOutUrl - The URL to which the user is redirected to\n * after signing out from the server.\n *\n * @return {boolean} - A boolean value indicating if the user has been signed out or not.\n *\n * @example\n * ```\n * const isSignedOut = auth.isSignOutSuccessful(<signout_url>);;\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#isSignOutSuccessful\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public static isSignOutSuccessful(afterSignOutUrl: string): boolean {\n return AsgardeoNodeClient.isSignOutSuccessful(afterSignOutUrl);\n }\n\n /**\n * This method returns if sign-out failed or not\n * @param {string} afterSignOutUrl - The URL to which the user is redirected to\n * after signing out from the server.\n *\n * @return {boolean} - A boolean value indicating if sign-out failed or not.\n *\n * @example\n * ```\n * const isSignedOut = auth.isSignOutSuccessful(<signout_url>);\n * ```\n *\n * @link https://github.com/asgardeo/asgardeo-auth-js-sdk/tree/master#didSignOutFail\n *\n * @memberof AsgardeoNodeClient\n *\n */\n public static didSignOutFail(afterSignOutUrl: string): boolean {\n return AsgardeoNodeClient.didSignOutFail(afterSignOutUrl);\n }\n\n public async getStorageManager(): Promise<StorageManager<T>> {\n return this.authCore.getStorageManager();\n }\n\n public async decodeJwtToken<K = Record<string, unknown>>(token: string): Promise<K> {\n return this.authCore.decodeJwtToken<K>(token);\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 {VendorConstants} from '@asgardeo/javascript';\n\nclass CookieConfig {\n static readonly SESSION_COOKIE_NAME: string = `__${VendorConstants.VENDOR_PREFIX}__session`;\n\n static readonly TEMP_SESSION_COOKIE_NAME: string = `__${VendorConstants.VENDOR_PREFIX}__temp.session`;\n\n static readonly DEFAULT_MAX_AGE: number = 3600;\n\n static readonly DEFAULT_HTTP_ONLY: boolean = true;\n\n static readonly DEFAULT_SAME_SITE: 'lax' | 'strict' | 'none' = 'lax';\n\n static readonly DEFAULT_SECURE: boolean = true;\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private constructor() {}\n}\n\nexport default CookieConfig;\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\nconst generateSessionId = (): string => new Date().getTime().toString(36) + Math.random().toString(36).substring(2);\n\nexport default generateSessionId;\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 CookieConfig from '../constants/CookieConfig';\nimport {CookieOptions} from '../models/cookies';\n\n/**\n * Creates a complete set of cookie options by merging provided options with defaults\n *\n * @param options - Partial cookie options to override defaults\n *\n * @returns Complete cookie options with all required fields\n *\n * @example\n * ```ts\n * // Use defaults with only maxAge override\n * const options = getSessionCookieOptions({ maxAge: 3600 });\n *\n * // Override multiple defaults\n * const options = getSessionCookieOptions({\n * maxAge: 3600,\n * secure: true,\n * sameSite: 'strict'\n * });\n * ```\n */\nconst getSessionCookieOptions = (options: Partial<CookieOptions>): CookieOptions => ({\n ...options,\n httpOnly: options.httpOnly ?? CookieConfig.DEFAULT_HTTP_ONLY,\n maxAge: options.maxAge ?? CookieConfig.DEFAULT_MAX_AGE,\n sameSite: options.sameSite ?? CookieConfig.DEFAULT_SAME_SITE,\n secure: options.secure ?? CookieConfig.DEFAULT_SECURE,\n});\n\nexport default getSessionCookieOptions;\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 {AsgardeoJavaScriptClient} from '@asgardeo/javascript';\nimport {AsgardeoNodeConfig} from './models/config';\n\n/**\n * Base class for implementing Asgardeo in Node.js based applications.\n * This class provides the core functionality for managing user authentication and sessions.\n *getConfigData\n * @typeParam T - Configuration type that extends AsgardeoNodeConfig.\n */\nabstract class AsgardeoNodeClient<T = AsgardeoNodeConfig> extends AsgardeoJavaScriptClient<T> {}\n\nexport default AsgardeoNodeClient;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA,yBAAgD;;;ACDhD,wBAaO;;;ACZP,0BAAkB;AAEX,IAAM,mBAAN,MAA0C;AAAA;AAAA,EAE/C,MAAa,QAAQ,KAAa,OAA8B;AAC9D,wBAAAA,QAAM,IAAI,KAAK,KAAK;AAAA,EACtB;AAAA;AAAA,EAGA,MAAa,QAAQ,KAA8B;AACjD,WAAO,oBAAAA,QAAM,IAAI,GAAG,KAAK;AAAA,EAC3B;AAAA;AAAA,EAGA,MAAa,WAAW,KAA4B;AAClD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,UAAU,CAAC;AAElH,IAAO,4BAAQ;;;ACqBf,IAAM,0BAA0B,CAAC,aAAoD;AAAA,EACnF,GAAG;AAAA,EACH,UAAU,QAAQ,YAAY,qBAAa;AAAA,EAC3C,QAAQ,QAAQ,UAAU,qBAAa;AAAA,EACvC,UAAU,QAAQ,YAAY,qBAAa;AAAA,EAC3C,QAAQ,QAAQ,UAAU,qBAAa;AACzC;AAEA,IAAO,kCAAQ;;;AC/Bf,IAAAC,qBAAuC;AASvC,IAAeC,sBAAf,cAAkE,4CAA4B;AAAC;AAE/F,IAAO,6BAAQA;;;AZaf,0BAAc,iCA1Cd;AAqBA,IAAI,CAAC,WAAW,OAAO;AACrB,aAAW,QAAQ,mBAAAC;AACnB,aAAW,UAAU;AACrB,aAAW,UAAU;AACrB,aAAW,WAAW;AACxB;",
6
6
  "names": ["cache", "uuidv4", "uuidValidate", "uuidVersion", "LogLevel", "base64url", "sha256", "randombytes", "import_javascript", "import_javascript", "AsgardeoNodeClient", "fetch"]
7
7
  }
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Copyright (c) 2022, WSO2 Inc. (http://www.wso2.com) All Rights Reserved.
2
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
3
  *
4
- * WSO2 Inc. licenses this file to you under the Apache License,
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
5
  * Version 2.0 (the "License"); you may not use this file except
6
6
  * in compliance with the License.
7
7
  * You may obtain a copy of the License at