diff --git a/.gitignore b/.gitignore index cd9444f8d..adc4008d3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ */DS_Store **/*.DS_Store .pnpm-store/* + # Generated code tmp/ e2e/**/dist @@ -30,9 +31,10 @@ packages/javascript-sdk/lib/ .swc .vite .env.serve.development +package-lock.json # Certificates -# *.pem +*.pem # IDEs .vscode @@ -83,4 +85,4 @@ outputs/* e2e/mock-api-v2/html/* -vitest.config.*.timestamp* \ No newline at end of file +vitest.config.*.timestamp* diff --git a/e2e/autoscript-apps/index.html b/e2e/autoscript-apps/index.html index 1a85e6f0e..03dd697a9 100644 --- a/e2e/autoscript-apps/index.html +++ b/e2e/autoscript-apps/index.html @@ -26,14 +26,18 @@ AuthN: Basic
AuthN: Self Service
AuthN: Central Login
+ AuthN: Central Login, no iframe
AuthN: Central Logout Ping
+ AuthN: Central Logout with Wellknown
AuthN: Device Profile
AuthN: Ping Protect
AuthN: Email Suspend
AuthN: Recaptcha Enterprise
AuthN: No Session
AuthN: OAuth
- AuthN: WellKnown
AuthN: Platform Login
AuthN: Second Factor
AuthN: SAML
diff --git a/e2e/autoscript-apps/src/authn-basic-self-service/autoscript.ts b/e2e/autoscript-apps/src/authn-basic-self-service/autoscript.ts index 2f6d47824..18a019231 100644 --- a/e2e/autoscript-apps/src/authn-basic-self-service/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-basic-self-service/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-basic/autoscript.ts b/e2e/autoscript-apps/src/authn-basic/autoscript.ts index dc986031f..1870bba87 100644 --- a/e2e/autoscript-apps/src/authn-basic/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-basic/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-central-login-no-iframe/autoscript.ts b/e2e/autoscript-apps/src/authn-central-login-no-iframe/autoscript.ts new file mode 100644 index 000000000..4b7b68ddd --- /dev/null +++ b/e2e/autoscript-apps/src/authn-central-login-no-iframe/autoscript.ts @@ -0,0 +1,145 @@ +/* + * @forgerock/javascript-sdk + * + * autoscript.ts + * + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ +// @ts-nocheck +import * as forgerock from '@forgerock/javascript-sdk'; +import { delay as rxDelay, map, mergeMap } from 'rxjs/operators'; +import { from } from 'rxjs'; + +function autoscript() { + const delay = 0; + + const url = new URL(window.location.href); + const amUrl = url.searchParams.get('amUrl') || 'http://localhost:9443/am'; + const preAuthenticated = url.searchParams.get('preAuthenticated') || 'false'; + const code = url.searchParams.get('code') || ''; + const clientId = url.searchParams.get('clientId'); + const client_id = url.searchParams.get('client_id'); + const error = url.searchParams.get('error_description') || false; + const realmPath = url.searchParams.get('realmPath') || 'root'; + const scope = url.searchParams.get('scope') || 'openid profile me.read'; + const state = url.searchParams.get('state') || ''; + const acr_values = url.searchParams.get('acr') || 'skipBackgroundRequest'; + // in central login we use an auth query param for the return of our mock 401 request + // this is to prevent the evaluation of the page before we have technically authenticated + const auth = url.searchParams.get('auth') || false; + + let tokenStore = url.searchParams.get('tokenStore') || 'localStorage'; + + // Support full redirects by setting storage, rather than rely purely on URL + if (!localStorage.getItem('tokenStore')) { + localStorage.setItem('tokenStore', tokenStore); + } else { + tokenStore = localStorage.getItem('tokenStore'); + } + + console.log('Configure the SDK'); + forgerock.Config.set({ + clientId: clientId || client_id || 'CentralLoginOAuthClient', + realmPath, + redirectUri: `${url.origin}/src/${ + preAuthenticated === 'false' ? 'authn-central-login' : '_callback' + }/`, + scope, + serverConfig: { + baseUrl: amUrl, + }, + tokenStore, + }); + + if (!code && !state) { + try { + forgerock.SessionManager.logout(); + } catch (err) { + // Do nothing + } + } + + console.log('Initiate first step with `undefined`'); + + // Wrapping in setTimeout to give the test time to bind listener to console.log + setTimeout(() => { + from([1]) + .pipe( + map(() => { + if (preAuthenticated === 'true') { + console.log('Set mock cookie to represent existing session'); + document.cookie = 'iPlanetDirectoryPro=abcd1234; domain=localhost; path=/'; + if (code && state) { + window.sessionStorage.setItem( + `FR-SDK-${clientId}`, + JSON.stringify({ responseType: 'code', state, verifier: '1234' }), + ); + } + } + return; + }), + rxDelay(delay), + mergeMap((step) => { + let tokens; + // detect when in iframe, throw as error if so + if (window.self !== window.top) { + throw new Error('Loaded_In_Iframe'); + } else if (code && state) { + tokens = forgerock.TokenManager.getTokens({ + query: { code, state, acr_values }, + }); + } else { + tokens = forgerock.TokenManager.getTokens({ + skipBackgroundRequest: true, + login: 'redirect', + query: { acr_values }, + }); + } + return tokens; + }), + map((tokens) => { + if (tokens.accessToken) { + console.log('OAuth authorization successful'); + document.body.innerHTML = '

Login successful

'; + } else { + throw new Error('Session_Error'); + } + }), + rxDelay(delay), + mergeMap(() => { + console.log('Remove cookie'); + document.cookie = ''; + console.log('Initiate logout'); + return forgerock.FRUser.logout(); + }), + ) + .subscribe({ + error: (err) => { + /* + * We added this because Playwright was too fast for the dom element. + * When we make a request to central login we have to force a 401 page to mimick the real life scenario of the page being requested + * If we do this, we append a query param of auth to make sure we don't complete the flow until we are redirected from that page + * By saying we have !auth query param value, we are essentially mimicking the idea that we are waiting for the central login redirect + * to complete the redirect. + */ + if (!auth) { + return; + } + console.log(`Error: ${err.message}`); + document.body.innerHTML = `

${err.message}

`; + localStorage.clear(); + }, + complete: () => { + console.log('Test script complete'); + document.body.innerHTML = `

Test script complete

`; + history.replaceState(null, null, window.location.origin + window.location.pathname); + localStorage.clear(); + }, + }); + }, 250); +} + +autoscript(); +export default autoscript; diff --git a/e2e/autoscript-apps/src/authn-wellknown/index.html b/e2e/autoscript-apps/src/authn-central-login-no-iframe/index.html similarity index 83% rename from e2e/autoscript-apps/src/authn-wellknown/index.html rename to e2e/autoscript-apps/src/authn-central-login-no-iframe/index.html index e7419ea4f..016c1758f 100644 --- a/e2e/autoscript-apps/src/authn-wellknown/index.html +++ b/e2e/autoscript-apps/src/authn-central-login-no-iframe/index.html @@ -28,8 +28,6 @@ - - - + diff --git a/e2e/autoscript-apps/src/authn-central-login-wellknown/autoscript.ts b/e2e/autoscript-apps/src/authn-central-login-wellknown/autoscript.ts index ed26ebbd0..61b2729f8 100644 --- a/e2e/autoscript-apps/src/authn-central-login-wellknown/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-central-login-wellknown/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -16,49 +16,50 @@ async function autoscript() { const delay = 0; const url = new URL(window.location.href); + const preAuthenticated = url.searchParams.get('preAuthenticated') || 'false'; const code = url.searchParams.get('code') || ''; - const error = url.searchParams.get('error') || ''; + const clientId = url.searchParams.get('clientId'); + const client_id = url.searchParams.get('client_id'); + const error = url.searchParams.get('error_description') || false; + const realmPath = url.searchParams.get('realmPath') || 'root'; + const scope = url.searchParams.get('scope') || 'openid profile me.read'; const state = url.searchParams.get('state') || ''; + const acr_values = url.searchParams.get('acr') || 'SpecificTree'; // in central login we use an auth query param for the return of our mock 401 request // this is to prevent the evaluation of the page before we have technically authenticated const auth = url.searchParams.get('auth') || false; - const acr_values = url.searchParams.get('acr') || 'SpecificTree'; + let wellknown = + url.searchParams.get('wellknown') || 'http://localhost:9443/am/.well-known/oidc-configuration'; - let clientId = url.searchParams.get('clientId') || 'CentralLoginOAuthClient'; - let realmPath = url.searchParams.get('realmPath') || 'root'; - // The `revoke` scope is required for PingOne support - let scope = url.searchParams.get('scope') || 'openid profile me.read revoke'; - let wellKnownUrl = - url.searchParams.get('wellKnownUrl') || - 'http://localhost:9443/am/.well-known/oidc-configuration'; + let tokenStore = url.searchParams.get('tokenStore') || 'localStorage'; - console.log('Configure the SDK'); - - if (wellKnownUrl) { - localStorage.setItem('wellknown', wellKnownUrl); - localStorage.setItem('clientId', clientId); - localStorage.setItem('realmPath', realmPath); - localStorage.setItem('scope', scope); + // Support full redirects by setting storage, rather than rely purely on URL + if (!localStorage.getItem('tokenStore')) { + localStorage.setItem('tokenStore', tokenStore); } else { - wellKnownUrl = localStorage.getItem('wellknown'); - clientId = localStorage.getItem('clientId'); - realmPath = localStorage.getItem('realmPath'); - scope = localStorage.getItem('scope'); + tokenStore = localStorage.getItem('tokenStore'); } - await forgerock.Config.setAsync({ - clientId, + + console.log('Configure the SDK'); + forgerock.Config.setAsync({ + clientId: clientId || client_id || 'CentralLoginOAuthClient', realmPath, - redirectUri: `${url.origin}/src/authn-central-login-wellknown/`, + redirectUri: `${url.origin}/src/${ + preAuthenticated === 'false' ? 'authn-central-login' : '_callback' + }/`, scope, serverConfig: { - wellknown: wellKnownUrl, + wellknown, }, + tokenStore, }); - try { - forgerock.SessionManager.logout(); - } catch (err) { - // Do nothing + if (!code && !state) { + try { + forgerock.SessionManager.logout(); + } catch (err) { + // Do nothing + } } console.log('Initiate first step with `undefined`'); @@ -67,15 +68,29 @@ async function autoscript() { setTimeout(() => { from([1]) .pipe( - mergeMap(() => { + map(() => { + if (preAuthenticated === 'true') { + console.log('Set mock cookie to represent existing session'); + document.cookie = 'iPlanetDirectoryPro=abcd1234; domain=localhost; path=/'; + if (code && state) { + window.sessionStorage.setItem( + `FR-SDK-authflow-${clientId}`, + JSON.stringify({ responseType: 'code', state, verifier: '1234' }), + ); + } + } + return; + }), + rxDelay(delay), + mergeMap((step) => { let tokens; - // detect when in iframe as to not call `/authorize` needlessly - if (window.self !== window.top) { + if (error) { + // Do nothing return; } else if (code && state) { tokens = forgerock.TokenManager.getTokens({ login: 'redirect', - query: { code, state }, + query: { code, state, acr_values }, }); } else { tokens = forgerock.TokenManager.getTokens({ @@ -98,7 +113,6 @@ async function autoscript() { console.log('Remove cookie'); document.cookie = ''; console.log('Initiate logout'); - // You have to allow specific origins to CORS for OAuth client return forgerock.FRUser.logout(); }), ) @@ -116,14 +130,12 @@ async function autoscript() { } console.log(`Error: ${err.message}`); document.body.innerHTML = `

${err.message}

`; + localStorage.clear(); }, complete: () => { console.log('Test script complete'); document.body.innerHTML = `

Test script complete

`; - localStorage.removeItem('wellknown'); - localStorage.removeItem('clientId'); - localStorage.removeItem('realmPath'); - localStorage.removeItem('scope'); + localStorage.clear(); }, }); }, 250); diff --git a/e2e/autoscript-apps/src/authn-central-login/autoscript.ts b/e2e/autoscript-apps/src/authn-central-login/autoscript.ts index 326012fe0..9ae95ecd3 100644 --- a/e2e/autoscript-apps/src/authn-central-login/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-central-login/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-central-logout/autoscript.ts b/e2e/autoscript-apps/src/authn-central-logout/autoscript.ts index e69a89cd8..885aeee5b 100644 --- a/e2e/autoscript-apps/src/authn-central-logout/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-central-logout/autoscript.ts @@ -5,7 +5,7 @@ import * as forgerock from '@forgerock/javascript-sdk'; * * index.html * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -42,9 +42,7 @@ async function autoscript() { const logout = async () => { try { - await forgerock.FRUser.logout({ - logoutRedirectUri: `${window.location.origin}${window.location.pathname}`, - }); + await forgerock.FRUser.logout(); } catch (error) { console.error(error); } @@ -67,7 +65,7 @@ async function autoscript() { * Passing no arguments or a key-value of `login: 'embedded'` means * the app handles authentication locally. */ - await forgerock.TokenManager.getTokens({ login: 'redirect' }); + await forgerock.TokenManager.getTokens({ login: 'redirect', skipBackgroundRequest: true }); const user = await forgerock.UserManager.getCurrentUser(); showUser(user); }); @@ -80,10 +78,9 @@ async function autoscript() { await forgerock.Config.setAsync({ clientId: '724ec718-c41c-4d51-98b0-84a583f450f9', // e.g. 'ForgeRockSDKClient' redirectUri: `${window.location.origin}${window.location.pathname}`, // Redirect back to your app, e.g. 'https://sdkapp.example.com:8443' - scope: 'openid profile email name revoke', // e.g. 'openid profile email address phone me.read' + scope: 'openid profile email revoke', // e.g. 'openid profile email address phone me.read' serverConfig: { - wellknown: - 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/.well-known/openid-configuration', + wellknown: 'https://pingone.petrov.ca/as/.well-known/openid-configuration', }, realmPath: '', // e.g. 'alpha' or 'root' }); diff --git a/e2e/autoscript-apps/src/authn-central-logout/index.html b/e2e/autoscript-apps/src/authn-central-logout/index.html index 45f767ba1..f5fee8878 100644 --- a/e2e/autoscript-apps/src/authn-central-logout/index.html +++ b/e2e/autoscript-apps/src/authn-central-logout/index.html @@ -9,6 +9,14 @@ rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" /> + diff --git a/e2e/autoscript-apps/src/authn-device-profile/autoscript.ts b/e2e/autoscript-apps/src/authn-device-profile/autoscript.ts index e53b33506..49827c1e8 100644 --- a/e2e/autoscript-apps/src/authn-device-profile/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-device-profile/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-email-suspend/autoscript.ts b/e2e/autoscript-apps/src/authn-email-suspend/autoscript.ts index 32166284c..c98742f28 100644 --- a/e2e/autoscript-apps/src/authn-email-suspend/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-email-suspend/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-no-session/autoscript.ts b/e2e/autoscript-apps/src/authn-no-session/autoscript.ts index cbeadaa8d..37e46f62e 100644 --- a/e2e/autoscript-apps/src/authn-no-session/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-no-session/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-oauth/autoscript.ts b/e2e/autoscript-apps/src/authn-oauth/autoscript.ts index 7f51c1d5e..96dcb5d6b 100644 --- a/e2e/autoscript-apps/src/authn-oauth/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-oauth/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -44,7 +44,7 @@ function autoscript() { next(); }, ], - redirectUri: `${url.origin}/_callback/`, + redirectUri: `${url.origin}/src/_callback/`, realmPath, scope, tree, diff --git a/e2e/autoscript-apps/src/authn-otp-reg/autoscript.ts b/e2e/autoscript-apps/src/authn-otp-reg/autoscript.ts index 080069579..37011e7d0 100644 --- a/e2e/autoscript-apps/src/authn-otp-reg/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-otp-reg/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-platform/autoscript.ts b/e2e/autoscript-apps/src/authn-platform/autoscript.ts index 242e8f221..8ddf1a56f 100644 --- a/e2e/autoscript-apps/src/authn-platform/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-platform/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-protect-metadata/autoscript.ts b/e2e/autoscript-apps/src/authn-protect-metadata/autoscript.ts index 50cbe1b7d..be815ac56 100644 --- a/e2e/autoscript-apps/src/authn-protect-metadata/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-protect-metadata/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2024 ForgeRock. All rights reserved. + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-protect/autoscript.ts b/e2e/autoscript-apps/src/authn-protect/autoscript.ts index 8dfbfc497..09dbcb9a1 100644 --- a/e2e/autoscript-apps/src/authn-protect/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-protect/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2024 ForgeRock. All rights reserved. + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-recaptcha-enterprise/autoscript.ts b/e2e/autoscript-apps/src/authn-recaptcha-enterprise/autoscript.ts index 61f8b6e61..974ea123c 100644 --- a/e2e/autoscript-apps/src/authn-recaptcha-enterprise/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-recaptcha-enterprise/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-saml/autoscript.ts b/e2e/autoscript-apps/src/authn-saml/autoscript.ts index d4cab3dc7..8f2cd08ca 100644 --- a/e2e/autoscript-apps/src/authn-saml/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-saml/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-second-factor/autoscript.ts b/e2e/autoscript-apps/src/authn-second-factor/autoscript.ts index 7f6c2c281..19603d0a0 100644 --- a/e2e/autoscript-apps/src/authn-second-factor/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-second-factor/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-social-login-am/autoscript.ts b/e2e/autoscript-apps/src/authn-social-login-am/autoscript.ts index 702b9d456..06fdcda7d 100644 --- a/e2e/autoscript-apps/src/authn-social-login-am/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-social-login-am/autoscript.ts @@ -3,7 +3,7 @@ * * authn-social-login-idm * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-social-login-idm/autoscript.ts b/e2e/autoscript-apps/src/authn-social-login-idm/autoscript.ts index 7ac2b5bd9..3afc600df 100644 --- a/e2e/autoscript-apps/src/authn-social-login-idm/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-social-login-idm/autoscript.ts @@ -3,7 +3,7 @@ * * authn-social-login-am * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-webauthn-device-registration/autoscript.ts b/e2e/autoscript-apps/src/authn-webauthn-device-registration/autoscript.ts index 63d513982..45da5486d 100644 --- a/e2e/autoscript-apps/src/authn-webauthn-device-registration/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-webauthn-device-registration/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authn-webauthn/autoscript.ts b/e2e/autoscript-apps/src/authn-webauthn/autoscript.ts index c9d06ea4a..2582f6a65 100644 --- a/e2e/autoscript-apps/src/authn-webauthn/autoscript.ts +++ b/e2e/autoscript-apps/src/authn-webauthn/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2024 Ping Identity. All rights reserved. + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. diff --git a/e2e/autoscript-apps/src/authn-wellknown/UsernamePassword.png b/e2e/autoscript-apps/src/authn-wellknown/UsernamePassword.png deleted file mode 100644 index 33e10da37..000000000 Binary files a/e2e/autoscript-apps/src/authn-wellknown/UsernamePassword.png and /dev/null differ diff --git a/e2e/autoscript-apps/src/authn-wellknown/autoscript.ts b/e2e/autoscript-apps/src/authn-wellknown/autoscript.ts deleted file mode 100644 index d8f8bd3dd..000000000 --- a/e2e/autoscript-apps/src/authn-wellknown/autoscript.ts +++ /dev/null @@ -1,156 +0,0 @@ -/* - * @forgerock/javascript-sdk - * - * autoscript.ts - * - * Copyright (c) 2020 ForgeRock. All rights reserved. - * This software may be modified and distributed under the terms - * of the MIT license. See the LICENSE file for details. - */ -// @ts-nocheck -import * as forgerock from '@forgerock/javascript-sdk'; -import { delay as rxDelay, map, mergeMap } from 'rxjs/operators'; -import { from } from 'rxjs'; - -async function autoscript() { - const delay = 0; - const tokenExpiredDelay = 2000; - - const url = new URL(window.location.href); - const clientId = url.searchParams.get('clientId') || 'WebOAuthClient'; - const realmPath = url.searchParams.get('realmPath') || 'root'; - const scope = url.searchParams.get('scope') || 'openid profile me.read'; - const un = url.searchParams.get('un') || 'sdkuser'; - const pw = url.searchParams.get('pw') || 'password'; - const tree = url.searchParams.get('tree') || 'UsernamePassword'; - const oauthThreshold = url.searchParams.get('oauthThreshold'); - const resourceOrigin = url.searchParams.get('resourceOrigin') || 'http://localhost:9443/resource'; - const igUrl = url.searchParams.get('igUrl'); // only use when testing against IG on different host - const wellKnownUrl = - url.searchParams.get('wellKnownUrl') || - 'http://localhost:9443/am/.well-known/oidc-configuration'; - - console.log('Configure the SDK'); - await forgerock.Config.setAsync({ - clientId, - middleware: [ - (req, action, next) => { - switch (action.type) { - case 'AUTHORIZE': - console.log('Calling authorize endpoint'); - break; - case 'EXCHANGE_TOKEN': - console.log('Calling access token exchange endpoint'); - break; - } - next(); - }, - ], - redirectUri: `${url.origin}/_callback/`, - realmPath, - scope, - tree, - serverConfig: { - wellknown: wellKnownUrl, - }, - oauthThreshold: oauthThreshold, - }); - - try { - forgerock.SessionManager.logout(); - } catch (err) { - // Do nothing - } - - console.log('Initiate first step with `undefined`'); - from(forgerock.FRAuth.next()) - .pipe( - mergeMap((step) => { - console.log('Set values on auth tree callbacks'); - step.getCallbackOfType('NameCallback').setName(un); - step.getCallbackOfType('PasswordCallback').setPassword(pw); - return forgerock.FRAuth.next(step); - }), - rxDelay(delay), - mergeMap((step) => { - if (step.payload.status === 401) { - throw new Error('Auth_Error'); - } - console.log('Auth tree successfully completed'); - console.log('Get OAuth tokens'); - const tokens = forgerock.TokenManager.getTokens(); - return tokens; - }), - rxDelay(delay), - map((tokens) => { - if (tokens.accessToken) { - console.log('OAuth login successful'); - document.body.innerHTML = '

Login successful

'; - } else { - throw new Error('Session_Error'); - } - return tokens; - }), - rxDelay(delay), - mergeMap( - (tokens) => { - console.log('Get user info from OAuth endpoint'); - const user = forgerock.UserManager.getCurrentUser(); - return user; - }, - (tokens, user) => { - console.log(`User's given name: ${user.family_name}`); - return tokens; - }, - ), - rxDelay(delay), - mergeMap( - (tokens) => { - console.log('Force renew OAuth tokens'); - return forgerock.TokenManager.getTokens({ forceRenew: true }); - }, - (oldTokens, newTokens) => { - if (oldTokens.accessToken !== newTokens.accessToken) { - console.log('New OAuth tokens retrieved'); - } else { - throw new Error('Force_Renew_Error'); - } - return newTokens; - }, - ), - rxDelay(delay), - mergeMap(() => { - console.log('Initiate logout'); - return forgerock.FRUser.logout(); - }), - rxDelay(delay), - mergeMap( - (step) => { - return forgerock.TokenStorage.get(); - }, - (step, tokens) => { - if (!tokens) { - console.log('Logout successful'); - document.body.innerHTML = '

Logout successful

'; - } else { - throw new Error('Logout_Error'); - } - return step; - }, - ), - rxDelay(delay), - ) - .subscribe({ - error: (err) => { - console.log(`Error: ${err.message}`); - document.body.innerHTML = `

${err.message}

`; - }, - complete: () => { - console.log('Test script complete'); - document.body.innerHTML = `

Test script complete

`; - }, - }); -} - -autoscript(); -export default autoscript; diff --git a/e2e/autoscript-apps/src/authz-token/autoscript.ts b/e2e/autoscript-apps/src/authz-token/autoscript.ts index e9e0ca0c7..a8f51bebd 100644 --- a/e2e/autoscript-apps/src/authz-token/autoscript.ts +++ b/e2e/autoscript-apps/src/authz-token/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authz-tree-basic-json/autoscript.ts b/e2e/autoscript-apps/src/authz-tree-basic-json/autoscript.ts index 65b0be6c1..1d0b18011 100644 --- a/e2e/autoscript-apps/src/authz-tree-basic-json/autoscript.ts +++ b/e2e/autoscript-apps/src/authz-tree-basic-json/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authz-tree-basic-redirect/autoscript.ts b/e2e/autoscript-apps/src/authz-tree-basic-redirect/autoscript.ts index f35549fca..9e16b7e93 100644 --- a/e2e/autoscript-apps/src/authz-tree-basic-redirect/autoscript.ts +++ b/e2e/autoscript-apps/src/authz-tree-basic-redirect/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authz-tree-oauth/autoscript.ts b/e2e/autoscript-apps/src/authz-tree-oauth/autoscript.ts index 7460ea184..fb88d7cd3 100644 --- a/e2e/autoscript-apps/src/authz-tree-oauth/autoscript.ts +++ b/e2e/autoscript-apps/src/authz-tree-oauth/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authz-txn-basic-json/autoscript.ts b/e2e/autoscript-apps/src/authz-txn-basic-json/autoscript.ts index b98a7b066..69fc8a2bc 100644 --- a/e2e/autoscript-apps/src/authz-txn-basic-json/autoscript.ts +++ b/e2e/autoscript-apps/src/authz-txn-basic-json/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authz-txn-basic-redirect/autoscript.ts b/e2e/autoscript-apps/src/authz-txn-basic-redirect/autoscript.ts index bcb97952f..711773728 100644 --- a/e2e/autoscript-apps/src/authz-txn-basic-redirect/autoscript.ts +++ b/e2e/autoscript-apps/src/authz-txn-basic-redirect/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/authz-txn-oauth/autoscript.ts b/e2e/autoscript-apps/src/authz-txn-oauth/autoscript.ts index 7fe18ff59..445cbbd16 100644 --- a/e2e/autoscript-apps/src/authz-txn-oauth/autoscript.ts +++ b/e2e/autoscript-apps/src/authz-txn-oauth/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/config-custom-paths/autoscript.ts b/e2e/autoscript-apps/src/config-custom-paths/autoscript.ts index e1bf9cd83..550041b48 100644 --- a/e2e/autoscript-apps/src/config-custom-paths/autoscript.ts +++ b/e2e/autoscript-apps/src/config-custom-paths/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/config-request-middleware/autoscript.ts b/e2e/autoscript-apps/src/config-request-middleware/autoscript.ts index f6d1a9ba8..be5fbafc6 100644 --- a/e2e/autoscript-apps/src/config-request-middleware/autoscript.ts +++ b/e2e/autoscript-apps/src/config-request-middleware/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/config-token-storage/autoscript.ts b/e2e/autoscript-apps/src/config-token-storage/autoscript.ts index b488e744b..3c03ebd48 100644 --- a/e2e/autoscript-apps/src/config-token-storage/autoscript.ts +++ b/e2e/autoscript-apps/src/config-token-storage/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/misc-callbacks/autoscript.ts b/e2e/autoscript-apps/src/misc-callbacks/autoscript.ts index 4d3793019..cec0e2952 100644 --- a/e2e/autoscript-apps/src/misc-callbacks/autoscript.ts +++ b/e2e/autoscript-apps/src/misc-callbacks/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/src/register-basic/autoscript.ts b/e2e/autoscript-apps/src/register-basic/autoscript.ts index f0f1c134d..6254ddc00 100644 --- a/e2e/autoscript-apps/src/register-basic/autoscript.ts +++ b/e2e/autoscript-apps/src/register-basic/autoscript.ts @@ -3,7 +3,7 @@ * * autoscript.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-apps/vite.config.ts b/e2e/autoscript-apps/vite.config.ts index f9d0a6219..54e2ae8a8 100644 --- a/e2e/autoscript-apps/vite.config.ts +++ b/e2e/autoscript-apps/vite.config.ts @@ -10,7 +10,6 @@ const pages = [ 'authn-email-suspend', 'authn-no-session', 'authn-oauth', - 'authn-wellknown', 'authn-platform', 'authn-saml', 'authn-second-factor', diff --git a/e2e/autoscript-suites/src/env.config.ts b/e2e/autoscript-suites/src/env.config.ts index 37d025f2d..40b6f46d5 100644 --- a/e2e/autoscript-suites/src/env.config.ts +++ b/e2e/autoscript-suites/src/env.config.ts @@ -3,7 +3,7 @@ * * env.config.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -64,6 +64,7 @@ export const APP_PORT = ports.app; export const AM_PORT = amPort; export const MOCK_PORT = ports.mock; +export const ACR = ''; export const AM_URL = `${amUrl}:${amPort}${paths.am}`; export const BASE_URL = `${origins.app}:${ports.app}`; export const CLIENT_ID = oauth.client; diff --git a/e2e/autoscript-suites/src/env.setup.ts b/e2e/autoscript-suites/src/env.setup.ts index 6997f54ce..11344ecf7 100644 --- a/e2e/autoscript-suites/src/env.setup.ts +++ b/e2e/autoscript-suites/src/env.setup.ts @@ -3,7 +3,7 @@ * * env.setup.js * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-basic.lc.neg.test.ts b/e2e/autoscript-suites/src/suites/authn-basic.lc.neg.test.ts index ad50871b3..5d24d3805 100644 --- a/e2e/autoscript-suites/src/suites/authn-basic.lc.neg.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-basic.lc.neg.test.ts @@ -3,7 +3,7 @@ * * authn-basic.lc.neg.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-basic.lc.test.ts b/e2e/autoscript-suites/src/suites/authn-basic.lc.test.ts index d352c5599..fba973c8b 100644 --- a/e2e/autoscript-suites/src/suites/authn-basic.lc.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-basic.lc.test.ts @@ -3,7 +3,7 @@ * * authn-basic.lc.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-central-login-no-iframe.test.ts b/e2e/autoscript-suites/src/suites/authn-central-login-no-iframe.test.ts new file mode 100644 index 000000000..a06be0436 --- /dev/null +++ b/e2e/autoscript-suites/src/suites/authn-central-login-no-iframe.test.ts @@ -0,0 +1,36 @@ +/* + * @forgerock/javascript-sdk + * + * authn-central-login.test.ts + * + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + +import { test, expect } from '@playwright/test'; +import { setupAndGo } from '../utilities/setup-and-go.js'; + +test.describe('Test OAuth login flow without iframe', () => { + // eslint-disable-next-line + test(`should use full redirect to request auth code, then token exchange`, async ({ + page, + browserName, + }) => { + const { messageArray, networkArray } = await setupAndGo( + page, + browserName, + 'authn-central-login-no-iframe/', + { acr: 'skipBackgroundRequest' }, + ); + + // Test assertions + // Test log messages + expect(messageArray.includes('OAuth authorization successful')).toBe(true); + expect(messageArray.includes('Test script complete')).toBe(true); + // Test network requests + // Authorize endpoint should use iframe, which is type "document" + expect(networkArray.includes('/am/oauth2/realms/root/authorize, document')).toBe(true); + expect(networkArray.includes('/am/oauth2/realms/root/access_token, fetch')).toBe(true); + }); +}); diff --git a/e2e/autoscript-suites/src/suites/authn-central-login-wellknown.test.ts b/e2e/autoscript-suites/src/suites/authn-central-login-wellknown.test.ts index 7ff1eecdc..f51c036d8 100644 --- a/e2e/autoscript-suites/src/suites/authn-central-login-wellknown.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-central-login-wellknown.test.ts @@ -3,7 +3,7 @@ * * authn-central-login-wellknown.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -12,8 +12,7 @@ import { test, expect } from '@playwright/test'; import { setupAndGo } from '../utilities/setup-and-go'; test.describe('Test OAuth login flow with .wellknown config', () => { - // eslint-disable-next-line - test(`should use full redirect to request auth code, then token exchange`, async ({ + test(`should use full redirect to FR for request auth code, then token exchange`, async ({ page, browserName, }) => { @@ -22,6 +21,9 @@ test.describe('Test OAuth login flow with .wellknown config', () => { browserName, 'authn-central-login-wellknown/', { + preAuthenticated: 'true', + code: 'foo', + state: 'abc123', clientId: 'CentralLoginOAuthClient', wellknown: 'http://localhost:9443/am/.well-known/oidc-configuration', }, @@ -31,9 +33,36 @@ test.describe('Test OAuth login flow with .wellknown config', () => { // Test log messages expect(messageArray.includes('OAuth authorization successful')).toBe(true); expect(messageArray.includes('Test script complete')).toBe(true); + + // Test network requests + expect(networkArray.includes('/am/json/realms/root/sessions, fetch')).toBe(true); + expect(networkArray.includes('/am/oauth2/realms/root/connect/endSession, fetch')).toBe(true); + }); + + test(`should use full redirect to PingOne with new Wellknown for request auth code, then token exchange`, async ({ + page, + browserName, + }) => { + const { messageArray, networkArray } = await setupAndGo( + page, + browserName, + 'authn-central-login-wellknown/', + { + preAuthenticated: 'true', + code: 'foo', + state: 'abc123', + clientId: 'CentralLoginOAuthClient', + wellknown: 'http://localhost:9443/as/.well-known/new-oidc-configuration', + }, + ); + + // Test assertions + // Test log messages + expect(messageArray.includes('OAuth authorization successful')).toBe(true); + expect(messageArray.includes('Test script complete')).toBe(true); + // Test network requests - // Authorize endpoint should use iframe, which is type "document" - expect(networkArray.includes('/am/oauth2/realms/root/authorize, document')).toBe(true); - expect(networkArray.includes('/am/oauth2/realms/root/access_token, fetch')).toBe(true); + expect(networkArray.includes('/am/json/realms/root/sessions, fetch')).toBe(false); + expect(networkArray.includes('/am/oauth2/realms/root/connect/idpEndSession, fetch')).toBe(true); }); }); diff --git a/e2e/autoscript-suites/src/suites/authn-central-login.test.ts b/e2e/autoscript-suites/src/suites/authn-central-login.test.ts index 11c50d5b5..51d17f9f1 100644 --- a/e2e/autoscript-suites/src/suites/authn-central-login.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-central-login.test.ts @@ -3,7 +3,7 @@ * * authn-central-login.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-central-logout.test.ts b/e2e/autoscript-suites/src/suites/authn-central-logout.test.ts index 10037e966..9c4234e2a 100644 --- a/e2e/autoscript-suites/src/suites/authn-central-logout.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-central-logout.test.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * authn-central-logout.test.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { test, expect } from '@playwright/test'; test('should login and logout with pingone', async ({ page }) => { @@ -9,13 +19,11 @@ test('should login and logout with pingone', async ({ page }) => { await expect(btn).toBeVisible(); await btn.click({ delay: 1000 }); await page.waitForURL(/ping/); - await page.getByRole('textbox', { name: 'Username' }).click(); - await page.getByPlaceholder('Username').fill('sdk.user'); - await page.getByRole('textbox', { name: 'Password' }).click(); - await page.getByRole('textbox', { name: 'Password' }).fill('XZY8gqn3gau*jmv1hwg'); + await page.getByPlaceholder('Username').fill('reactdavinci@user.com'); + await page.getByRole('textbox', { name: 'Password' }).fill('abc123!ABC'); await page.getByRole('button', { name: 'Sign On' }).click(); - await expect(page.getByText('preferred_username')).toContainText('sdk.user'); + await expect(page.getByText('preferred_username')).toContainText('reactdavinci@user.com'); await page.getByRole('button', { name: 'Sign Out' }).click({ clickCount: 1, delay: 300 }); await page.getByRole('button', { name: 'Login' }).click({ delay: 300 }); await page.waitForRequest(/pingone/); diff --git a/e2e/autoscript-suites/src/suites/authn-device-profile.lc.test.ts b/e2e/autoscript-suites/src/suites/authn-device-profile.lc.test.ts index b67778349..d0a5b05c2 100644 --- a/e2e/autoscript-suites/src/suites/authn-device-profile.lc.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-device-profile.lc.test.ts @@ -3,7 +3,7 @@ * * authn-device-profile.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-email-suspend.test.ts b/e2e/autoscript-suites/src/suites/authn-email-suspend.test.ts index 9f5dde2c6..e9251bb8e 100644 --- a/e2e/autoscript-suites/src/suites/authn-email-suspend.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-email-suspend.test.ts @@ -3,7 +3,7 @@ * * authn-email-suspend.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-no-session.lc.test.ts b/e2e/autoscript-suites/src/suites/authn-no-session.lc.test.ts index 55815680d..b27dd642e 100644 --- a/e2e/autoscript-suites/src/suites/authn-no-session.lc.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-no-session.lc.test.ts @@ -3,7 +3,7 @@ * * authn-no-session.lc.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-oauth.lc.test.ts b/e2e/autoscript-suites/src/suites/authn-oauth.lc.test.ts index 14006141a..34bbe0cec 100644 --- a/e2e/autoscript-suites/src/suites/authn-oauth.lc.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-oauth.lc.test.ts @@ -3,7 +3,7 @@ * * authn-oauth.lc.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-otp-reg.test.ts b/e2e/autoscript-suites/src/suites/authn-otp-reg.test.ts index 6bfeed9fb..3137b65eb 100644 --- a/e2e/autoscript-suites/src/suites/authn-otp-reg.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-otp-reg.test.ts @@ -3,7 +3,7 @@ * * authn-otp-reg.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-ping-marketplace.test.ts b/e2e/autoscript-suites/src/suites/authn-ping-marketplace.test.ts index d29322a02..82b47683d 100644 --- a/e2e/autoscript-suites/src/suites/authn-ping-marketplace.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-ping-marketplace.test.ts @@ -3,7 +3,7 @@ * * authn-otp-reg.test.ts * - * Copyright (c) 2024 ForgeRock. All rights reserved. + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-platform.lc.test.ts b/e2e/autoscript-suites/src/suites/authn-platform.lc.test.ts index 45c34bd0d..f4f08e92a 100644 --- a/e2e/autoscript-suites/src/suites/authn-platform.lc.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-platform.lc.test.ts @@ -3,7 +3,7 @@ * * authn-platform.lc.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-protect.test.ts b/e2e/autoscript-suites/src/suites/authn-protect.test.ts index b877f056e..da472c026 100644 --- a/e2e/autoscript-suites/src/suites/authn-protect.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-protect.test.ts @@ -3,7 +3,7 @@ * * authn-basic.lc.test.ts * - * Copyright (c) 2024 ForgeRock. All rights reserved. + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-saml.test.ts b/e2e/autoscript-suites/src/suites/authn-saml.test.ts index 8fae80eee..901504847 100644 --- a/e2e/autoscript-suites/src/suites/authn-saml.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-saml.test.ts @@ -3,7 +3,7 @@ * * authn-social-login-am.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-second-factor.test.ts b/e2e/autoscript-suites/src/suites/authn-second-factor.test.ts index cea7aab94..6fc5fb3f2 100644 --- a/e2e/autoscript-suites/src/suites/authn-second-factor.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-second-factor.test.ts @@ -3,7 +3,7 @@ * * authn-second-factor.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-social-login-am.test.ts b/e2e/autoscript-suites/src/suites/authn-social-login-am.test.ts index 6479c12bd..5a69e200b 100644 --- a/e2e/autoscript-suites/src/suites/authn-social-login-am.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-social-login-am.test.ts @@ -3,7 +3,7 @@ * * authn-social-login-am.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authn-social-login-idm.test.ts b/e2e/autoscript-suites/src/suites/authn-social-login-idm.test.ts index baf34f338..42e0616fb 100644 --- a/e2e/autoscript-suites/src/suites/authn-social-login-idm.test.ts +++ b/e2e/autoscript-suites/src/suites/authn-social-login-idm.test.ts @@ -3,7 +3,7 @@ * * authn-social-login-idm.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authz-token.test.ts b/e2e/autoscript-suites/src/suites/authz-token.test.ts index 5d8f77a69..66c85ad11 100644 --- a/e2e/autoscript-suites/src/suites/authz-token.test.ts +++ b/e2e/autoscript-suites/src/suites/authz-token.test.ts @@ -3,7 +3,7 @@ * * authz-token.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authz-tree-basic-json.test.ts b/e2e/autoscript-suites/src/suites/authz-tree-basic-json.test.ts index 99dac0bf3..0948369d5 100644 --- a/e2e/autoscript-suites/src/suites/authz-tree-basic-json.test.ts +++ b/e2e/autoscript-suites/src/suites/authz-tree-basic-json.test.ts @@ -3,7 +3,7 @@ * * authz-tree-basic-json.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authz-tree-basic-redirect.test.ts b/e2e/autoscript-suites/src/suites/authz-tree-basic-redirect.test.ts index 9d19c1d64..861506e87 100644 --- a/e2e/autoscript-suites/src/suites/authz-tree-basic-redirect.test.ts +++ b/e2e/autoscript-suites/src/suites/authz-tree-basic-redirect.test.ts @@ -3,7 +3,7 @@ // * // * authz-tree-basic-redirect.test.ts // * -// * Copyright (c) 2020 ForgeRock. All rights reserved. +// * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. // * This software may be modified and distributed under the terms // * of the MIT license. See the LICENSE file for details. // */ diff --git a/e2e/autoscript-suites/src/suites/authz-txn-basic-json.test.ts b/e2e/autoscript-suites/src/suites/authz-txn-basic-json.test.ts index 003be7790..5c8409eba 100644 --- a/e2e/autoscript-suites/src/suites/authz-txn-basic-json.test.ts +++ b/e2e/autoscript-suites/src/suites/authz-txn-basic-json.test.ts @@ -3,7 +3,7 @@ * * authz-txn-basic-json.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/authz-txn-basic-redirect.test.ts b/e2e/autoscript-suites/src/suites/authz-txn-basic-redirect.test.ts index 9359a36ca..b7aa7028b 100644 --- a/e2e/autoscript-suites/src/suites/authz-txn-basic-redirect.test.ts +++ b/e2e/autoscript-suites/src/suites/authz-txn-basic-redirect.test.ts @@ -3,7 +3,7 @@ * * authz-txn-basic-redirect.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/config-custom-paths.test.ts b/e2e/autoscript-suites/src/suites/config-custom-paths.test.ts index eb93718f1..44a1e3719 100644 --- a/e2e/autoscript-suites/src/suites/config-custom-paths.test.ts +++ b/e2e/autoscript-suites/src/suites/config-custom-paths.test.ts @@ -3,7 +3,7 @@ * * config-custom-paths.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/config-request-middleware.test.ts b/e2e/autoscript-suites/src/suites/config-request-middleware.test.ts index c445c2371..8bd9e7135 100644 --- a/e2e/autoscript-suites/src/suites/config-request-middleware.test.ts +++ b/e2e/autoscript-suites/src/suites/config-request-middleware.test.ts @@ -3,7 +3,7 @@ * * config-request-middleware.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/config-token-storage.test.ts b/e2e/autoscript-suites/src/suites/config-token-storage.test.ts index f53090075..952e00194 100644 --- a/e2e/autoscript-suites/src/suites/config-token-storage.test.ts +++ b/e2e/autoscript-suites/src/suites/config-token-storage.test.ts @@ -3,7 +3,7 @@ * * config-token-storage.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/misc-callbacks.lc.test.ts b/e2e/autoscript-suites/src/suites/misc-callbacks.lc.test.ts index 8b8ff41ac..4e6d949da 100644 --- a/e2e/autoscript-suites/src/suites/misc-callbacks.lc.test.ts +++ b/e2e/autoscript-suites/src/suites/misc-callbacks.lc.test.ts @@ -3,7 +3,7 @@ * * misc-callbacks.lc.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/register-basic.lc.test.ts b/e2e/autoscript-suites/src/suites/register-basic.lc.test.ts index 516ec8a10..1725d55d1 100644 --- a/e2e/autoscript-suites/src/suites/register-basic.lc.test.ts +++ b/e2e/autoscript-suites/src/suites/register-basic.lc.test.ts @@ -3,7 +3,7 @@ * * register-basic.lc.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/suites/send-request-header.test.ts b/e2e/autoscript-suites/src/suites/send-request-header.test.ts index 38805ad0d..3906b7e6f 100644 --- a/e2e/autoscript-suites/src/suites/send-request-header.test.ts +++ b/e2e/autoscript-suites/src/suites/send-request-header.test.ts @@ -3,7 +3,7 @@ * * send-request-header.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/autoscript-suites/src/utilities/setup-and-go.ts b/e2e/autoscript-suites/src/utilities/setup-and-go.ts index a451302fa..d56bb9429 100644 --- a/e2e/autoscript-suites/src/utilities/setup-and-go.ts +++ b/e2e/autoscript-suites/src/utilities/setup-and-go.ts @@ -3,19 +3,29 @@ * * setup-and-go.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ import type { Page } from '@playwright/test'; -import { AM_URL, BASE_URL, CLIENT_ID, RESOURCE_URL, SCOPE, REALM_PATH, USERS } from '../env.config'; +import { + ACR, + AM_URL, + BASE_URL, + CLIENT_ID, + RESOURCE_URL, + SCOPE, + REALM_PATH, + USERS, +} from '../env.config'; export async function setupAndGo( page: Page, browserType: string, path: string, config?: { + acr?: string; allowGeo?: boolean; amUrl?: string; pauseBehaviorData?: string; // for protect behavioral data collection @@ -52,6 +62,7 @@ export async function setupAndGo( // If anything fails, ensure we close the browser to end the process const url = new URL(`${BASE_URL}/src/${path}`); + url.searchParams.set('acr', (config && config.acr) || ACR); url.searchParams.set('amUrl', (config && config.amUrl) || AM_URL); url.searchParams.set('pauseBehaviorData', (config && config.pauseBehaviorData) || ''); url.searchParams.set('clientId', (config && config.clientId) || CLIENT_ID); diff --git a/e2e/mock-api-v2/src/endpoints/custom-html.endpoint.ts b/e2e/mock-api-v2/src/endpoints/custom-html.endpoint.ts index 6dd5015cc..333f9384a 100644 --- a/e2e/mock-api-v2/src/endpoints/custom-html.endpoint.ts +++ b/e2e/mock-api-v2/src/endpoints/custom-html.endpoint.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { pipe } from 'effect'; import { Api, ApiResponse } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/endpoints/davinci-authorize.endpoint.ts b/e2e/mock-api-v2/src/endpoints/davinci-authorize.endpoint.ts index 5fbd3084b..2eb465254 100644 --- a/e2e/mock-api-v2/src/endpoints/davinci-authorize.endpoint.ts +++ b/e2e/mock-api-v2/src/endpoints/davinci-authorize.endpoint.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { pipe } from 'effect'; import { Api } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/endpoints/open-id-configuration.endpoint.ts b/e2e/mock-api-v2/src/endpoints/open-id-configuration.endpoint.ts index fe041aed4..69ebc86c2 100644 --- a/e2e/mock-api-v2/src/endpoints/open-id-configuration.endpoint.ts +++ b/e2e/mock-api-v2/src/endpoints/open-id-configuration.endpoint.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { pipe } from 'effect'; import { Api } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/endpoints/token.endpoint.ts b/e2e/mock-api-v2/src/endpoints/token.endpoint.ts index 5bbffa469..6d739ac8d 100644 --- a/e2e/mock-api-v2/src/endpoints/token.endpoint.ts +++ b/e2e/mock-api-v2/src/endpoints/token.endpoint.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { pipe } from 'effect'; import { Api } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/endpoints/userinfo.endpoint.ts b/e2e/mock-api-v2/src/endpoints/userinfo.endpoint.ts index 7eb41b1f5..e4828c84c 100644 --- a/e2e/mock-api-v2/src/endpoints/userinfo.endpoint.ts +++ b/e2e/mock-api-v2/src/endpoints/userinfo.endpoint.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { pipe } from 'effect'; import { Api, ApiResponse, Security } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/errors/index.ts b/e2e/mock-api-v2/src/errors/index.ts index a456c16a2..d1f5b8375 100644 --- a/e2e/mock-api-v2/src/errors/index.ts +++ b/e2e/mock-api-v2/src/errors/index.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + class InvalidUsernamePassword { readonly _tag = 'InvalidUsernamePassword'; } diff --git a/e2e/mock-api-v2/src/example-server.ts b/e2e/mock-api-v2/src/example-server.ts index cb784c137..c6d53db08 100644 --- a/e2e/mock-api-v2/src/example-server.ts +++ b/e2e/mock-api-v2/src/example-server.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { RouterBuilder, Middlewares, ExampleServer } from 'effect-http'; import { NodeRuntime } from '@effect/platform-node'; import { NodeServer } from 'effect-http-node'; diff --git a/e2e/mock-api-v2/src/handlers/authorize.handler.ts b/e2e/mock-api-v2/src/handlers/authorize.handler.ts index 16249e9ee..40c917732 100644 --- a/e2e/mock-api-v2/src/handlers/authorize.handler.ts +++ b/e2e/mock-api-v2/src/handlers/authorize.handler.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { toCookieHeader } from '@effect/platform/Cookies'; import { Effect } from 'effect'; import { RouterBuilder } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/handlers/custom-html-template.handler.ts b/e2e/mock-api-v2/src/handlers/custom-html-template.handler.ts index 129dbfd39..f3f3a21d7 100644 --- a/e2e/mock-api-v2/src/handlers/custom-html-template.handler.ts +++ b/e2e/mock-api-v2/src/handlers/custom-html-template.handler.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { toCookieHeader } from '@effect/platform/Cookies'; import { Effect } from 'effect'; import { RouterBuilder } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/handlers/open-id-configuration.handler.ts b/e2e/mock-api-v2/src/handlers/open-id-configuration.handler.ts index 2a1e3a8c7..128bb6922 100644 --- a/e2e/mock-api-v2/src/handlers/open-id-configuration.handler.ts +++ b/e2e/mock-api-v2/src/handlers/open-id-configuration.handler.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Effect } from 'effect'; import { RouterBuilder } from 'effect-http'; import { apiSpec } from '../spec.js'; diff --git a/e2e/mock-api-v2/src/handlers/token.handler.ts b/e2e/mock-api-v2/src/handlers/token.handler.ts index b3683ad83..6ab4f2c3c 100644 --- a/e2e/mock-api-v2/src/handlers/token.handler.ts +++ b/e2e/mock-api-v2/src/handlers/token.handler.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Effect } from 'effect'; import { RouterBuilder } from 'effect-http'; import { apiSpec } from '../spec.js'; diff --git a/e2e/mock-api-v2/src/handlers/userinfo.handler.ts b/e2e/mock-api-v2/src/handlers/userinfo.handler.ts index 31d017891..6931f4efb 100644 --- a/e2e/mock-api-v2/src/handlers/userinfo.handler.ts +++ b/e2e/mock-api-v2/src/handlers/userinfo.handler.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Effect } from 'effect'; import { RouterBuilder } from 'effect-http'; import { apiSpec } from '../spec.js'; diff --git a/e2e/mock-api-v2/src/helpers/cookie.ts b/e2e/mock-api-v2/src/helpers/cookie.ts index 7fb50a721..9ee75cb7e 100644 --- a/e2e/mock-api-v2/src/helpers/cookie.ts +++ b/e2e/mock-api-v2/src/helpers/cookie.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Cookies } from '@effect/platform'; import { Effect, Option, pipe } from 'effect'; diff --git a/e2e/mock-api-v2/src/helpers/match.ts b/e2e/mock-api-v2/src/helpers/match.ts index 42bad7690..1d8e41238 100644 --- a/e2e/mock-api-v2/src/helpers/match.ts +++ b/e2e/mock-api-v2/src/helpers/match.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { Effect, Match } from 'effect'; diff --git a/e2e/mock-api-v2/src/helpers/test/cookie.test.ts b/e2e/mock-api-v2/src/helpers/test/cookie.test.ts index 89f890c4a..fecf0f8c7 100644 --- a/e2e/mock-api-v2/src/helpers/test/cookie.test.ts +++ b/e2e/mock-api-v2/src/helpers/test/cookie.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { it, expect } from '@effect/vitest'; import { getElementFromCookie, diff --git a/e2e/mock-api-v2/src/helpers/test/match.test.ts b/e2e/mock-api-v2/src/helpers/test/match.test.ts index 33c5eefff..6ff4568ee 100644 --- a/e2e/mock-api-v2/src/helpers/test/match.test.ts +++ b/e2e/mock-api-v2/src/helpers/test/match.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { it, expect } from '@effect/vitest'; import { PingRequestData, validator } from '../match.js'; import { Effect, Exit } from 'effect'; diff --git a/e2e/mock-api-v2/src/main.ts b/e2e/mock-api-v2/src/main.ts index b309f91bc..6cec2a3f5 100644 --- a/e2e/mock-api-v2/src/main.ts +++ b/e2e/mock-api-v2/src/main.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Config, Effect, Layer, pipe } from 'effect'; import { RouterBuilder, Middlewares } from 'effect-http'; import { NodeRuntime } from '@effect/platform-node'; diff --git a/e2e/mock-api-v2/src/responses/custom-html-template/ping-protect-node.ts b/e2e/mock-api-v2/src/responses/custom-html-template/ping-protect-node.ts index f9b89c316..0c55e8f08 100644 --- a/e2e/mock-api-v2/src/responses/custom-html-template/ping-protect-node.ts +++ b/e2e/mock-api-v2/src/responses/custom-html-template/ping-protect-node.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + const PingProtectNode = { interactionId: '1894775c-ba76-4989-a303-320f0547c66e', connectorId: 'api', diff --git a/e2e/mock-api-v2/src/responses/custom-html-template/username-password.ts b/e2e/mock-api-v2/src/responses/custom-html-template/username-password.ts index 48550e1b4..242e4593f 100644 --- a/e2e/mock-api-v2/src/responses/custom-html-template/username-password.ts +++ b/e2e/mock-api-v2/src/responses/custom-html-template/username-password.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + const customHtmlUsernamePassword = { id: 'cq77vwelou', eventName: 'continue', diff --git a/e2e/mock-api-v2/src/responses/index.ts b/e2e/mock-api-v2/src/responses/index.ts index a5759ae9a..a31723142 100644 --- a/e2e/mock-api-v2/src/responses/index.ts +++ b/e2e/mock-api-v2/src/responses/index.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Array } from 'effect'; import { UsernamePassword } from './username-password.js'; import { PingProtectNode } from './custom-html-template/ping-protect-node.js'; diff --git a/e2e/mock-api-v2/src/responses/invalid-username-password.ts b/e2e/mock-api-v2/src/responses/invalid-username-password.ts index 5c4400858..8cf88613d 100644 --- a/e2e/mock-api-v2/src/responses/invalid-username-password.ts +++ b/e2e/mock-api-v2/src/responses/invalid-username-password.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + const InvalidUsernamePassword = { interactionId: '18127a84-2fdb-40c7-8d61-78f9116449a5', companyId: '02fb4743-189a-4bc7-9d6c-a919edfe6447', diff --git a/e2e/mock-api-v2/src/responses/open-id-configuration.ts b/e2e/mock-api-v2/src/responses/open-id-configuration.ts index 73d36783e..b9fa7b58f 100644 --- a/e2e/mock-api-v2/src/responses/open-id-configuration.ts +++ b/e2e/mock-api-v2/src/responses/open-id-configuration.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + const openidConfigurationResponse = { issuer: 'http://localhost:9443/02fb4743-189a-4bc7-9d6c-a919edfe6447/as', authorization_endpoint: 'http://localhost:9443/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/authorize', diff --git a/e2e/mock-api-v2/src/responses/return-success-redirect.ts b/e2e/mock-api-v2/src/responses/return-success-redirect.ts index 6ad791f95..3a8979ede 100644 --- a/e2e/mock-api-v2/src/responses/return-success-redirect.ts +++ b/e2e/mock-api-v2/src/responses/return-success-redirect.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + const returnSuccessResponseRedirect = { interactionId: '174edeee-6d5d-4a4c-925e-d5e6a91b9956', companyId: '02fb4743-189a-4bc7-9d6c-a919edfe6447', diff --git a/e2e/mock-api-v2/src/responses/token/token.ts b/e2e/mock-api-v2/src/responses/token/token.ts index 5a9bcfc99..bf96b20d5 100644 --- a/e2e/mock-api-v2/src/responses/token/token.ts +++ b/e2e/mock-api-v2/src/responses/token/token.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + const tokenRequestBody = { client_id: '724ec718-c41c-4d51-98b0-84a583f450f9', code: '17a4a4fd-61b4-46c6-a185-3bbb4e3f297e', diff --git a/e2e/mock-api-v2/src/responses/userinfo/userinfo.ts b/e2e/mock-api-v2/src/responses/userinfo/userinfo.ts index 7eb79ed7b..dfb2ee92b 100644 --- a/e2e/mock-api-v2/src/responses/userinfo/userinfo.ts +++ b/e2e/mock-api-v2/src/responses/userinfo/userinfo.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + const userInfoResponse = { sub: '6f00a1ba-1d86-4b87-afb0-0ea1a952bc2e', preferred_username: 'demouser', diff --git a/e2e/mock-api-v2/src/responses/username-password.ts b/e2e/mock-api-v2/src/responses/username-password.ts index 636b59d99..05a31ec5b 100644 --- a/e2e/mock-api-v2/src/responses/username-password.ts +++ b/e2e/mock-api-v2/src/responses/username-password.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + const UsernamePassword = { interactionId: '1857e57f-aaad-43a5-9054-259683ae6e36', interactionToken: diff --git a/e2e/mock-api-v2/src/schemas/authorize.schema.ts b/e2e/mock-api-v2/src/schemas/authorize.schema.ts index 970fab7c9..dc479b10c 100644 --- a/e2e/mock-api-v2/src/schemas/authorize.schema.ts +++ b/e2e/mock-api-v2/src/schemas/authorize.schema.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; const AuthorizePath = Schema.Struct({ envid: Schema.String }); diff --git a/e2e/mock-api-v2/src/schemas/custom-html-template/custom-html-template-request.schema.ts b/e2e/mock-api-v2/src/schemas/custom-html-template/custom-html-template-request.schema.ts index 36618822f..a26e7b447 100644 --- a/e2e/mock-api-v2/src/schemas/custom-html-template/custom-html-template-request.schema.ts +++ b/e2e/mock-api-v2/src/schemas/custom-html-template/custom-html-template-request.schema.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; /** diff --git a/e2e/mock-api-v2/src/schemas/custom-html-template/custom-html-template-response.schema.ts b/e2e/mock-api-v2/src/schemas/custom-html-template/custom-html-template-response.schema.ts index d94c0aac9..6e6f77496 100644 --- a/e2e/mock-api-v2/src/schemas/custom-html-template/custom-html-template-response.schema.ts +++ b/e2e/mock-api-v2/src/schemas/custom-html-template/custom-html-template-response.schema.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; const PingOnePathParams = Schema.Struct({ envid: Schema.String, connectionid: Schema.String }); diff --git a/e2e/mock-api-v2/src/schemas/open-id-configuration/open-id-configuration-response.schema.ts b/e2e/mock-api-v2/src/schemas/open-id-configuration/open-id-configuration-response.schema.ts index 71bd3ea49..af7c99ff0 100644 --- a/e2e/mock-api-v2/src/schemas/open-id-configuration/open-id-configuration-response.schema.ts +++ b/e2e/mock-api-v2/src/schemas/open-id-configuration/open-id-configuration-response.schema.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; const _openIdConfigurationResponseSchema = Schema.Struct({ diff --git a/e2e/mock-api-v2/src/schemas/return-success-response-redirect.schema.ts b/e2e/mock-api-v2/src/schemas/return-success-response-redirect.schema.ts index b3d2562d9..7a5ec39a3 100644 --- a/e2e/mock-api-v2/src/schemas/return-success-response-redirect.schema.ts +++ b/e2e/mock-api-v2/src/schemas/return-success-response-redirect.schema.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; const _SuccessResponseRedirect = Schema.Struct({ diff --git a/e2e/mock-api-v2/src/schemas/token/token.schema.ts b/e2e/mock-api-v2/src/schemas/token/token.schema.ts index 11cadbe1f..60a9e32b2 100644 --- a/e2e/mock-api-v2/src/schemas/token/token.schema.ts +++ b/e2e/mock-api-v2/src/schemas/token/token.schema.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; const _TokenRequestBody = Schema.Struct({ diff --git a/e2e/mock-api-v2/src/schemas/userinfo/userinfo.schema.ts b/e2e/mock-api-v2/src/schemas/userinfo/userinfo.schema.ts index 6a0ecf7b0..fa679968a 100644 --- a/e2e/mock-api-v2/src/schemas/userinfo/userinfo.schema.ts +++ b/e2e/mock-api-v2/src/schemas/userinfo/userinfo.schema.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; const _UserInfoSchema = Schema.Struct({ diff --git a/e2e/mock-api-v2/src/services/authorize.service.ts b/e2e/mock-api-v2/src/services/authorize.service.ts index 7f342e64c..66ef99150 100644 --- a/e2e/mock-api-v2/src/services/authorize.service.ts +++ b/e2e/mock-api-v2/src/services/authorize.service.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { Context, Effect, Layer, pipe } from 'effect'; import { HttpError } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/services/cookie.service.ts b/e2e/mock-api-v2/src/services/cookie.service.ts index 3d7070592..273aa36c7 100644 --- a/e2e/mock-api-v2/src/services/cookie.service.ts +++ b/e2e/mock-api-v2/src/services/cookie.service.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import * as Cookies from '@effect/platform/Cookies'; import { Effect, Context, Either } from 'effect'; diff --git a/e2e/mock-api-v2/src/services/custom-html-template.service.ts b/e2e/mock-api-v2/src/services/custom-html-template.service.ts index b40a72293..b437bfb30 100644 --- a/e2e/mock-api-v2/src/services/custom-html-template.service.ts +++ b/e2e/mock-api-v2/src/services/custom-html-template.service.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Context, Effect, Layer } from 'effect'; import { HttpError } from 'effect-http'; import { Request } from './request.service.js'; diff --git a/e2e/mock-api-v2/src/services/mock-env-helpers/index.ts b/e2e/mock-api-v2/src/services/mock-env-helpers/index.ts index 098ca6b22..137f0d871 100644 --- a/e2e/mock-api-v2/src/services/mock-env-helpers/index.ts +++ b/e2e/mock-api-v2/src/services/mock-env-helpers/index.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { Array, Effect, Option, pipe } from 'effect'; diff --git a/e2e/mock-api-v2/src/services/mock-env-helpers/tests/index.test.ts b/e2e/mock-api-v2/src/services/mock-env-helpers/tests/index.test.ts index c706d64a4..555f472bd 100644 --- a/e2e/mock-api-v2/src/services/mock-env-helpers/tests/index.test.ts +++ b/e2e/mock-api-v2/src/services/mock-env-helpers/tests/index.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { it, expect } from '@effect/vitest'; import { Effect, Option } from 'effect'; import { diff --git a/e2e/mock-api-v2/src/services/request.service.ts b/e2e/mock-api-v2/src/services/request.service.ts index 8f1ab0414..78e4bd796 100644 --- a/e2e/mock-api-v2/src/services/request.service.ts +++ b/e2e/mock-api-v2/src/services/request.service.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Effect, Context, pipe, Layer } from 'effect'; import { HttpError } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/services/tests/authorize.service.test.ts b/e2e/mock-api-v2/src/services/tests/authorize.service.test.ts index a3cd13663..0c7addb41 100644 --- a/e2e/mock-api-v2/src/services/tests/authorize.service.test.ts +++ b/e2e/mock-api-v2/src/services/tests/authorize.service.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { it, expect } from '@effect/vitest'; import { Effect, Layer } from 'effect'; import { Authorize, authorizeMock } from '../authorize.service.js'; diff --git a/e2e/mock-api-v2/src/services/tests/cookie.service.test.ts b/e2e/mock-api-v2/src/services/tests/cookie.service.test.ts index a792f15e6..c7b1e6e4e 100644 --- a/e2e/mock-api-v2/src/services/tests/cookie.service.test.ts +++ b/e2e/mock-api-v2/src/services/tests/cookie.service.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { it, expect } from '@effect/vitest'; import { CookieService, cookieServiceTest } from '../cookie.service.js'; import { Effect, Either } from 'effect'; diff --git a/e2e/mock-api-v2/src/services/tests/custom-html-template.service.test.ts b/e2e/mock-api-v2/src/services/tests/custom-html-template.service.test.ts index 5cd4024b7..a3d1e94f4 100644 --- a/e2e/mock-api-v2/src/services/tests/custom-html-template.service.test.ts +++ b/e2e/mock-api-v2/src/services/tests/custom-html-template.service.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { it, expect } from '@effect/vitest'; import { CustomHtmlTemplate, mockCustomHtmlTemplate } from '../custom-html-template.service.js'; import { Effect, Exit, Layer } from 'effect'; diff --git a/e2e/mock-api-v2/src/services/tests/request.service.test.ts b/e2e/mock-api-v2/src/services/tests/request.service.test.ts index 8a45001ea..f65a3294f 100644 --- a/e2e/mock-api-v2/src/services/tests/request.service.test.ts +++ b/e2e/mock-api-v2/src/services/tests/request.service.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { it, expect } from '@effect/vitest'; import { Request, mockRequest } from '../request.service.js'; import { Effect } from 'effect'; diff --git a/e2e/mock-api-v2/src/services/tests/token.service.test.ts b/e2e/mock-api-v2/src/services/tests/token.service.test.ts index 4447e420f..3857e110a 100644 --- a/e2e/mock-api-v2/src/services/tests/token.service.test.ts +++ b/e2e/mock-api-v2/src/services/tests/token.service.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { it, expect } from '@effect/vitest'; import { Tokens, mockTokens } from '../tokens.service.js'; import { Effect, Exit, Layer } from 'effect'; diff --git a/e2e/mock-api-v2/src/services/tests/userinfo.service.test.ts b/e2e/mock-api-v2/src/services/tests/userinfo.service.test.ts index 6b57b6875..f43ae7734 100644 --- a/e2e/mock-api-v2/src/services/tests/userinfo.service.test.ts +++ b/e2e/mock-api-v2/src/services/tests/userinfo.service.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { expect, it } from '@effect/vitest'; import { UserInfo, userInfoMock } from '../userinfo.service.js'; import { userInfoResponse } from '../../responses/userinfo/userinfo.js'; diff --git a/e2e/mock-api-v2/src/services/tokens.service.ts b/e2e/mock-api-v2/src/services/tokens.service.ts index b1a79adf8..06878cfe3 100644 --- a/e2e/mock-api-v2/src/services/tokens.service.ts +++ b/e2e/mock-api-v2/src/services/tokens.service.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { Context, Effect, Layer } from 'effect'; import { HttpError } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/services/userinfo.service.ts b/e2e/mock-api-v2/src/services/userinfo.service.ts index 6e70633b1..5f79747a2 100644 --- a/e2e/mock-api-v2/src/services/userinfo.service.ts +++ b/e2e/mock-api-v2/src/services/userinfo.service.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { Effect, Context } from 'effect'; import { HttpError } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/spec.ts b/e2e/mock-api-v2/src/spec.ts index cbe43a4c0..3d8a07864 100644 --- a/e2e/mock-api-v2/src/spec.ts +++ b/e2e/mock-api-v2/src/spec.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { pipe } from 'effect'; import { Schema } from '@effect/schema'; import { Api } from 'effect-http'; diff --git a/e2e/mock-api-v2/src/types/index.ts b/e2e/mock-api-v2/src/types/index.ts index a038ff975..f681c549d 100644 --- a/e2e/mock-api-v2/src/types/index.ts +++ b/e2e/mock-api-v2/src/types/index.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { Schema } from '@effect/schema'; import { DavinciAuthorizeHeaders, DavinciAuthorizeQuery } from '../schemas/authorize.schema.js'; import { diff --git a/e2e/mock-api/src/app/app.auth.js b/e2e/mock-api/src/app/app.auth.js index 45f75e3f5..71d160dd0 100644 --- a/e2e/mock-api/src/app/app.auth.js +++ b/e2e/mock-api/src/app/app.auth.js @@ -3,7 +3,7 @@ * * app.auth.js * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/mock-api/src/app/constants.js b/e2e/mock-api/src/app/constants.js index e9bba07ed..6e7b8240a 100644 --- a/e2e/mock-api/src/app/constants.js +++ b/e2e/mock-api/src/app/constants.js @@ -3,7 +3,7 @@ * * constants.js * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -36,6 +36,7 @@ export const authPaths = { endSession: [ '/am/auth/endSession', '/am/oauth2/realms/root/connect/endSession', + '/am/oauth2/realms/root/connect/idpEndSession', '/am/oauth2/realms/root/realms/middleware/connect/endSession', '/am/oauth2/realms/root/realms/tokens-expiring-soon/connect/endSession', '/am/oauth2/realms/root/realms/tokens-expired/connect/endSession', diff --git a/e2e/mock-api/src/app/env.config.js b/e2e/mock-api/src/app/env.config.js index c34d7c8de..e6bc01a1c 100644 --- a/e2e/mock-api/src/app/env.config.js +++ b/e2e/mock-api/src/app/env.config.js @@ -3,7 +3,7 @@ * * env.config.js * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/mock-api/src/app/response.registration.js b/e2e/mock-api/src/app/response.registration.js index 3ec70f2f9..527147371 100644 --- a/e2e/mock-api/src/app/response.registration.js +++ b/e2e/mock-api/src/app/response.registration.js @@ -3,7 +3,7 @@ * * response.registration.js * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/mock-api/src/app/responses.js b/e2e/mock-api/src/app/responses.js index 12cc6173d..ccd1052fe 100644 --- a/e2e/mock-api/src/app/responses.js +++ b/e2e/mock-api/src/app/responses.js @@ -3,7 +3,7 @@ * * responses.js * - * Copyright (c) 2020-2024 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -1032,6 +1032,7 @@ export const wellKnownForgeRock = { registration_endpoint: 'http://localhost:9443/am/oauth2/realms/root/register', }; +// NOT USED export const wellKnownPing = { issuer: 'https://ping.example.com:9443/02fb4743-189a-4bc7-9d6c-a919edfe6447/as', authorization_endpoint: @@ -1120,6 +1121,87 @@ export const wellKnownPing = { code_challenge_methods_supported: ['plain', 'S256'], }; +export const newPiWellKnown = { + issuer: 'http://localhost:9443/am', + authorization_endpoint: 'http://localhost:9443/am/oauth2/realms/root/authorize', + token_endpoint: 'http://localhost:9443/am/oauth2/realms/root/access_token', + userinfo_endpoint: 'http://localhost:9443/am/oauth2/realms/root/userinfo', + jwks_uri: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/jwks', + end_session_endpoint: 'http://localhost:9443/am/oauth2/realms/root/connect/endSession', + ping_end_idp_session_endpoint: + 'http://localhost:9443/am/oauth2/realms/root/connect/idpEndSession', + introspection_endpoint: 'http://localhost:9443/am/oauth2/realms/root/introspect', + revocation_endpoint: 'http://localhost:9443/am/oauth2/realms/root/token/revoke', + claims_parameter_supported: false, + request_parameter_supported: true, + request_uri_parameter_supported: false, + require_pushed_authorization_requests: false, + scopes_supported: ['openid', 'profile', 'email', 'address', 'phone', 'offline_access'], + response_types_supported: [ + 'code', + 'id_token', + 'token id_token', + 'code id_token', + 'code token', + 'code token id_token', + ], + response_modes_supported: ['pi.flow', 'query', 'fragment', 'form_post'], + grant_types_supported: [ + 'authorization_code', + 'implicit', + 'client_credentials', + 'refresh_token', + 'urn:ietf:params:oauth:grant-type:device_code', + ], + subject_types_supported: ['public'], + id_token_signing_alg_values_supported: ['RS256'], + userinfo_signing_alg_values_supported: ['none'], + request_object_signing_alg_values_supported: [ + 'none', + 'HS256', + 'HS384', + 'HS512', + 'RS256', + 'RS384', + 'RS512', + ], + token_endpoint_auth_methods_supported: [ + 'client_secret_basic', + 'client_secret_post', + 'client_secret_jwt', + 'private_key_jwt', + ], + token_endpoint_auth_signing_alg_values_supported: [ + 'HS256', + 'HS384', + 'HS512', + 'RS256', + 'RS384', + 'RS512', + ], + claim_types_supported: ['normal'], + claims_supported: [ + 'sub', + 'iss', + 'auth_time', + 'acr', + 'name', + 'given_name', + 'family_name', + 'middle_name', + 'preferred_username', + 'profile', + 'picture', + 'zoneinfo', + 'phone_number', + 'updated_at', + 'address', + 'email', + 'locale', + ], + code_challenge_methods_supported: ['plain', 'S256'], +}; + export const MetadataMarketPlaceInitialize = { authId: 'foo', callbacks: [ diff --git a/e2e/mock-api/src/app/routes.auth.js b/e2e/mock-api/src/app/routes.auth.js index 95768433d..3d13208ea 100644 --- a/e2e/mock-api/src/app/routes.auth.js +++ b/e2e/mock-api/src/app/routes.auth.js @@ -3,7 +3,7 @@ * * routes.auth.js * - * Copyright (c) 2020-2024 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -44,10 +44,10 @@ import { txnAuthz, otpQRCodeCallbacks, wellKnownForgeRock, - wellKnownPing, recaptchaEnterpriseCallback, MetadataMarketPlaceInitialize, MetadataMarketPlacePingOneEvaluation, + newPiWellKnown, } from './responses.js'; import initialRegResponse from './response.registration.js'; import wait from './wait.js'; @@ -520,7 +520,10 @@ export default function (app) { redirectUrl.searchParams.set('state', req.query.state); res.redirect(redirectUrl); - } else if (req.cookies.redirected === 'true') { + } else if ( + req.cookies.redirected === 'true' || + req.query['acr_values'] === 'skipBackgroundRequest' + ) { res.redirect(loginUrl); } else { res.cookie('redirected', 'true'); @@ -635,7 +638,7 @@ export default function (app) { res.send(wellKnownForgeRock); }); - app.get('/as/.well-known/oidc-configuration', (req, res) => { - res.send(wellKnownPing); + app.get('/as/.well-known/new-oidc-configuration', (req, res) => { + res.send(newPiWellKnown); }); } diff --git a/e2e/mock-api/src/app/routes.resource.js b/e2e/mock-api/src/app/routes.resource.js index e6c9313ed..d10dc278a 100644 --- a/e2e/mock-api/src/app/routes.resource.js +++ b/e2e/mock-api/src/app/routes.resource.js @@ -3,7 +3,7 @@ * * routes.resource.js * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/mock-api/src/app/wait.js b/e2e/mock-api/src/app/wait.js index be41fb7cc..3738de1fa 100644 --- a/e2e/mock-api/src/app/wait.js +++ b/e2e/mock-api/src/app/wait.js @@ -3,7 +3,7 @@ * * wait.js * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/mock-api/src/index.js b/e2e/mock-api/src/index.js index 7d80a924c..316259834 100644 --- a/e2e/mock-api/src/index.js +++ b/e2e/mock-api/src/index.js @@ -3,7 +3,7 @@ * * index.js * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/e2e/token-vault-app/src/main.ts b/e2e/token-vault-app/src/main.ts index 4fc0aa793..70a21b95f 100644 --- a/e2e/token-vault-app/src/main.ts +++ b/e2e/token-vault-app/src/main.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + /* eslint-disable @typescript-eslint/no-unused-vars */ import { Config, FRUser, TokenManager, UserManager } from '@forgerock/javascript-sdk'; import { client } from '@forgerock/token-vault'; diff --git a/e2e/token-vault-interceptor/src/interceptor.ts b/e2e/token-vault-interceptor/src/interceptor.ts index 4f18458b1..0829df3de 100644 --- a/e2e/token-vault-interceptor/src/interceptor.ts +++ b/e2e/token-vault-interceptor/src/interceptor.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { interceptor } from '@forgerock/token-vault'; // Initialize the token vault interceptor diff --git a/e2e/token-vault-proxy/src/main.ts b/e2e/token-vault-proxy/src/main.ts index 44a260108..46f8b3926 100644 --- a/e2e/token-vault-proxy/src/main.ts +++ b/e2e/token-vault-proxy/src/main.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { proxy } from '@forgerock/token-vault'; // Initialize the token vault proxy diff --git a/e2e/token-vault-suites/src/basic.test.ts b/e2e/token-vault-suites/src/basic.test.ts index de98d126e..78ebd6a50 100644 --- a/e2e/token-vault-suites/src/basic.test.ts +++ b/e2e/token-vault-suites/src/basic.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { expect, test } from '@playwright/test'; import { asyncEvents } from './utils/async-events'; diff --git a/e2e/token-vault-suites/src/utils/async-events.ts b/e2e/token-vault-suites/src/utils/async-events.ts index d601fcea9..2b1013406 100644 --- a/e2e/token-vault-suites/src/utils/async-events.ts +++ b/e2e/token-vault-suites/src/utils/async-events.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + export function asyncEvents(page) { return { async clickButton(text, endpoint) { diff --git a/packages/javascript-sdk/CHANGELOG.md b/packages/javascript-sdk/CHANGELOG.md index 8e4f41cd6..bcc64c161 100644 --- a/packages/javascript-sdk/CHANGELOG.md +++ b/packages/javascript-sdk/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 4.8.0 + +### Minor Changes + +- [#535](https://github.com/ForgeRock/forgerock-javascript-sdk/pull/535) [`a5daf4c`](https://github.com/ForgeRock/forgerock-javascript-sdk/commit/a5daf4cbb4ae9039eaf34d8369e5c92c488e17dd) Thanks [@cerebrl](https://github.com/cerebrl)! - Add new PingOne signoff, remove unneeded /session call, add flag for iframe + +- [#537](https://github.com/ForgeRock/forgerock-javascript-sdk/pull/537) [`fc00259`](https://github.com/ForgeRock/forgerock-javascript-sdk/commit/fc0025941348a90994bd3931194b13a694964619) Thanks [@cerebrl](https://github.com/cerebrl)! - Add feature to provide JSON outcome response to callback if requested + ## 4.7.0 ### Minor Changes diff --git a/packages/javascript-sdk/LICENSE b/packages/javascript-sdk/LICENSE index e5396cc66..454c90559 100644 --- a/packages/javascript-sdk/LICENSE +++ b/packages/javascript-sdk/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 ForgeRock +Copyright (c) 2019-2025 Ping Identity Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/javascript-sdk/package.json b/packages/javascript-sdk/package.json index 4ac6ba0e1..344438c94 100644 --- a/packages/javascript-sdk/package.json +++ b/packages/javascript-sdk/package.json @@ -1,10 +1,12 @@ { "name": "@forgerock/javascript-sdk", - "version": "4.7.0", + "version": "4.8.0", "description": "ForgeRock JavaScript SDK", "author": "ForgeRock", "license": "MIT", - "files": ["dist/*"], + "files": [ + "dist/*" + ], "repository": { "type": "git", "url": "git+https://github.com:ForgeRock/forgerock-javascript-sdk.git", diff --git a/packages/javascript-sdk/src/auth/enums.ts b/packages/javascript-sdk/src/auth/enums.ts index 435769fe3..7de7de5b0 100644 --- a/packages/javascript-sdk/src/auth/enums.ts +++ b/packages/javascript-sdk/src/auth/enums.ts @@ -3,7 +3,7 @@ * * enums.ts * - * Copyright (c) 2020-2024 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/auth/index.ts b/packages/javascript-sdk/src/auth/index.ts index 682f06b55..f6def8f0e 100644 --- a/packages/javascript-sdk/src/auth/index.ts +++ b/packages/javascript-sdk/src/auth/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/auth/interfaces.ts b/packages/javascript-sdk/src/auth/interfaces.ts index e022d2a56..3ca161633 100644 --- a/packages/javascript-sdk/src/auth/interfaces.ts +++ b/packages/javascript-sdk/src/auth/interfaces.ts @@ -3,7 +3,7 @@ * * interfaces.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/config/constants.ts b/packages/javascript-sdk/src/config/constants.ts index 1a301ecc5..a0b24ff93 100644 --- a/packages/javascript-sdk/src/config/constants.ts +++ b/packages/javascript-sdk/src/config/constants.ts @@ -3,7 +3,7 @@ * * constants.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/config/enums.ts b/packages/javascript-sdk/src/config/enums.ts index 75ba147a8..095953f5d 100644 --- a/packages/javascript-sdk/src/config/enums.ts +++ b/packages/javascript-sdk/src/config/enums.ts @@ -3,7 +3,7 @@ * * enums.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/config/helpers.test.ts b/packages/javascript-sdk/src/config/helpers.test.ts index c1b2ca168..9736d79e4 100644 --- a/packages/javascript-sdk/src/config/helpers.test.ts +++ b/packages/javascript-sdk/src/config/helpers.test.ts @@ -1,5 +1,15 @@ +/* + * @forgerock/javascript-sdk + * + * helpers.test.ts + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { convertWellKnown } from './helpers'; -import { frWellKnown, piWellKnown } from './well-known.mock'; +import { frWellKnown, newPiWellKnown, piWellKnown } from './well-known.mock'; describe('Test config helpers', () => { it('should test wellknown response conversion ForgeRock', () => { @@ -33,4 +43,19 @@ describe('Test config helpers', () => { }; expect(result).toStrictEqual(expected); }); + + it('should test the new wellknown response conversion from Ping', () => { + const result = convertWellKnown(newPiWellKnown); + const expected = { + baseUrl: 'https://auth.pingone.ca', + paths: { + accessToken: '/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/token', + authorize: '/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/authorize', + endSession: '/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/idpSignoff', + revoke: '/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/revoke', + userInfo: '/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/userinfo', + }, + }; + expect(result).toStrictEqual(expected); + }); }); diff --git a/packages/javascript-sdk/src/config/helpers.ts b/packages/javascript-sdk/src/config/helpers.ts index 5f1c56208..fa99623ae 100644 --- a/packages/javascript-sdk/src/config/helpers.ts +++ b/packages/javascript-sdk/src/config/helpers.ts @@ -3,7 +3,7 @@ * * helpers.ts * - * Copyright (c) 2024 ForgeRock. All rights reserved. + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -46,7 +46,7 @@ export function convertWellKnown(data: WellKnownResponse, options?: ServerConfig ...(authenticateUrl ? { authenticate: new URL(authenticateUrl).pathname } : {}), authorize: new URL(data.authorization_endpoint).pathname, accessToken: new URL(data.token_endpoint).pathname, - endSession: new URL(data.end_session_endpoint).pathname, + endSession: new URL(data.ping_end_idp_session_endpoint || data.end_session_endpoint).pathname, userInfo: new URL(data.userinfo_endpoint).pathname, revoke: new URL(data.revocation_endpoint).pathname, ...(sessionsUrl ? { sessions: new URL(sessionsUrl).pathname } : {}), diff --git a/packages/javascript-sdk/src/config/index.ts b/packages/javascript-sdk/src/config/index.ts index 020aff13f..a01ab34e1 100644 --- a/packages/javascript-sdk/src/config/index.ts +++ b/packages/javascript-sdk/src/config/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020-2024 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/config/interfaces.ts b/packages/javascript-sdk/src/config/interfaces.ts index 7d183d373..08fc450f6 100644 --- a/packages/javascript-sdk/src/config/interfaces.ts +++ b/packages/javascript-sdk/src/config/interfaces.ts @@ -3,7 +3,7 @@ * * interfaces.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -131,6 +131,7 @@ interface WellKnownResponse { token_endpoint: string; userinfo_endpoint: string; end_session_endpoint: string; + ping_end_idp_session_endpoint?: string; introspection_endpoint: string; revocation_endpoint: string; jwks_uri?: string; diff --git a/packages/javascript-sdk/src/config/well-known.mock.ts b/packages/javascript-sdk/src/config/well-known.mock.ts index 2a4d955ab..e8a8ae46c 100644 --- a/packages/javascript-sdk/src/config/well-known.mock.ts +++ b/packages/javascript-sdk/src/config/well-known.mock.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * well-known.mock.ts + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + export const frWellKnown = { request_parameter_supported: true, pushed_authorization_request_endpoint: @@ -418,3 +428,90 @@ export const piWellKnown = { ], code_challenge_methods_supported: ['plain', 'S256'], }; + +export const newPiWellKnown = { + issuer: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as', + authorization_endpoint: + 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/authorize', + pushed_authorization_request_endpoint: + 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/par', + token_endpoint: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/token', + userinfo_endpoint: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/userinfo', + jwks_uri: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/jwks', + end_session_endpoint: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/signoff', + ping_end_idp_session_endpoint: + 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/idpSignoff', + introspection_endpoint: + 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/introspect', + revocation_endpoint: 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/revoke', + device_authorization_endpoint: + 'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/device_authorization', + claims_parameter_supported: false, + request_parameter_supported: true, + request_uri_parameter_supported: false, + require_pushed_authorization_requests: false, + scopes_supported: ['openid', 'profile', 'email', 'address', 'phone', 'offline_access'], + response_types_supported: [ + 'code', + 'id_token', + 'token id_token', + 'code id_token', + 'code token', + 'code token id_token', + ], + response_modes_supported: ['pi.flow', 'query', 'fragment', 'form_post'], + grant_types_supported: [ + 'authorization_code', + 'implicit', + 'client_credentials', + 'refresh_token', + 'urn:ietf:params:oauth:grant-type:device_code', + ], + subject_types_supported: ['public'], + id_token_signing_alg_values_supported: ['RS256'], + userinfo_signing_alg_values_supported: ['none'], + request_object_signing_alg_values_supported: [ + 'none', + 'HS256', + 'HS384', + 'HS512', + 'RS256', + 'RS384', + 'RS512', + ], + token_endpoint_auth_methods_supported: [ + 'client_secret_basic', + 'client_secret_post', + 'client_secret_jwt', + 'private_key_jwt', + ], + token_endpoint_auth_signing_alg_values_supported: [ + 'HS256', + 'HS384', + 'HS512', + 'RS256', + 'RS384', + 'RS512', + ], + claim_types_supported: ['normal'], + claims_supported: [ + 'sub', + 'iss', + 'auth_time', + 'acr', + 'name', + 'given_name', + 'family_name', + 'middle_name', + 'preferred_username', + 'profile', + 'picture', + 'zoneinfo', + 'phone_number', + 'updated_at', + 'address', + 'email', + 'locale', + ], + code_challenge_methods_supported: ['plain', 'S256'], +}; diff --git a/packages/javascript-sdk/src/device-client/device.store.test.ts b/packages/javascript-sdk/src/device-client/device.store.test.ts index 20cb1dd40..897e45b0e 100644 --- a/packages/javascript-sdk/src/device-client/device.store.test.ts +++ b/packages/javascript-sdk/src/device-client/device.store.test.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * device.store.test.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { afterEach, afterAll, beforeAll, describe, expect, it } from 'vitest'; import { http, HttpResponse } from 'msw'; import { setupServer } from 'msw/node'; diff --git a/packages/javascript-sdk/src/device-client/device.store.ts b/packages/javascript-sdk/src/device-client/device.store.ts index 4a045c737..b0c58e383 100644 --- a/packages/javascript-sdk/src/device-client/device.store.ts +++ b/packages/javascript-sdk/src/device-client/device.store.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * device.store.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { type ConfigOptions } from '../config/interfaces'; import { configureStore } from '@reduxjs/toolkit'; diff --git a/packages/javascript-sdk/src/device-client/services/index.ts b/packages/javascript-sdk/src/device-client/services/index.ts index 151130ed0..ecc2752d9 100644 --- a/packages/javascript-sdk/src/device-client/services/index.ts +++ b/packages/javascript-sdk/src/device-client/services/index.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * index.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'; import { DeletedOathDevice, diff --git a/packages/javascript-sdk/src/device-client/types/bound-device.types.ts b/packages/javascript-sdk/src/device-client/types/bound-device.types.ts index a4d93c918..4ae430e90 100644 --- a/packages/javascript-sdk/src/device-client/types/bound-device.types.ts +++ b/packages/javascript-sdk/src/device-client/types/bound-device.types.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * bound-device.types.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + export type GetBoundDevicesQuery = { userId: string; realm?: string; diff --git a/packages/javascript-sdk/src/device-client/types/index.ts b/packages/javascript-sdk/src/device-client/types/index.ts index d1af79e63..2019cc543 100644 --- a/packages/javascript-sdk/src/device-client/types/index.ts +++ b/packages/javascript-sdk/src/device-client/types/index.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * index.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + export * from './oath.types.js'; export * from './webauthn.types.js'; export * from './push-device.types.js'; diff --git a/packages/javascript-sdk/src/device-client/types/oath.types.ts b/packages/javascript-sdk/src/device-client/types/oath.types.ts index 68c068057..fc601ec8e 100644 --- a/packages/javascript-sdk/src/device-client/types/oath.types.ts +++ b/packages/javascript-sdk/src/device-client/types/oath.types.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * oath.types.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + export type OathDevice = { _id: string; deviceManagementStatus: boolean; diff --git a/packages/javascript-sdk/src/device-client/types/profile-device.types.ts b/packages/javascript-sdk/src/device-client/types/profile-device.types.ts index 448634fd5..c25ad5d27 100644 --- a/packages/javascript-sdk/src/device-client/types/profile-device.types.ts +++ b/packages/javascript-sdk/src/device-client/types/profile-device.types.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * profile-device.types.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + export interface GetProfileDevices { realm: string; userId: string; diff --git a/packages/javascript-sdk/src/device-client/types/push-device.types.ts b/packages/javascript-sdk/src/device-client/types/push-device.types.ts index 908bbfac4..a59958fe8 100644 --- a/packages/javascript-sdk/src/device-client/types/push-device.types.ts +++ b/packages/javascript-sdk/src/device-client/types/push-device.types.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * push-device.types.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + export type PushDeviceQuery = { realm?: string; userId: string; diff --git a/packages/javascript-sdk/src/device-client/types/updateDeviceProfile.types.ts b/packages/javascript-sdk/src/device-client/types/updateDeviceProfile.types.ts index 16108fc53..803ab3f02 100644 --- a/packages/javascript-sdk/src/device-client/types/updateDeviceProfile.types.ts +++ b/packages/javascript-sdk/src/device-client/types/updateDeviceProfile.types.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * updateDeviceProfile.types.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + type Device = { platform: string; version: 34; diff --git a/packages/javascript-sdk/src/device-client/types/webauthn.types.ts b/packages/javascript-sdk/src/device-client/types/webauthn.types.ts index 5b722806b..31295d1fb 100644 --- a/packages/javascript-sdk/src/device-client/types/webauthn.types.ts +++ b/packages/javascript-sdk/src/device-client/types/webauthn.types.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * webauthn.types.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + export type WebAuthnQuery = { realm?: string; userId: string; diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/attribute-input-callback.test.ts b/packages/javascript-sdk/src/fr-auth/callbacks/attribute-input-callback.test.ts index ab0841164..99b386adc 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/attribute-input-callback.test.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/attribute-input-callback.test.ts @@ -3,7 +3,7 @@ * * attribute-input-callback.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/attribute-input-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/attribute-input-callback.ts index df11c7486..7d3abeb12 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/attribute-input-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/attribute-input-callback.ts @@ -3,7 +3,7 @@ * * attribute-input-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/choice-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/choice-callback.ts index 1eceb731a..cfa92292c 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/choice-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/choice-callback.ts @@ -3,7 +3,7 @@ * * choice-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/confirmation-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/confirmation-callback.ts index 50f3fba18..dfae9f326 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/confirmation-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/confirmation-callback.ts @@ -3,7 +3,7 @@ * * confirmation-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/device-profile-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/device-profile-callback.ts index 577c0fcd0..a5cf96e7c 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/device-profile-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/device-profile-callback.ts @@ -3,7 +3,7 @@ * * device-profile-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/factory.ts b/packages/javascript-sdk/src/fr-auth/callbacks/factory.ts index 854b0baff..633f5fd25 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/factory.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/factory.ts @@ -3,7 +3,7 @@ * * factory.ts * - * Copyright (c) 2020-2024 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/fr-auth-callback.test.ts b/packages/javascript-sdk/src/fr-auth/callbacks/fr-auth-callback.test.ts index 38c33c854..6f4c7262d 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/fr-auth-callback.test.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/fr-auth-callback.test.ts @@ -3,7 +3,7 @@ * * fr-auth-callback.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/hidden-value-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/hidden-value-callback.ts index 9967fd3f3..cb149d600 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/hidden-value-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/hidden-value-callback.ts @@ -3,7 +3,7 @@ * * hidden-value-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/index.ts b/packages/javascript-sdk/src/fr-auth/callbacks/index.ts index 392f01bcf..49e7f69db 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/index.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/kba-create-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/kba-create-callback.ts index 5469b38e5..f10c9edc5 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/kba-create-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/kba-create-callback.ts @@ -3,7 +3,7 @@ * * kba-create-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/metadata-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/metadata-callback.ts index 56f5418fa..df33367a5 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/metadata-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/metadata-callback.ts @@ -3,7 +3,7 @@ * * metadata-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/name-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/name-callback.ts index 17ef43875..316148c47 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/name-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/name-callback.ts @@ -3,7 +3,7 @@ * * name-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/password-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/password-callback.ts index 5ac558acf..fbe406d79 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/password-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/password-callback.ts @@ -3,7 +3,7 @@ * * password-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-evaluation-callback.test.ts b/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-evaluation-callback.test.ts index a7c719ea8..e71b47739 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-evaluation-callback.test.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-evaluation-callback.test.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * ping-protect-evaluation-callback.test.ts + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { vi, describe, it, expect } from 'vitest'; import { CallbackType } from '../../auth/enums'; import PingOneProtectEvaluationCallback from './ping-protect-evaluation-callback'; diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-evaluation-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-evaluation-callback.ts index e50cf13d7..741d9fc57 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-evaluation-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-evaluation-callback.ts @@ -3,7 +3,7 @@ * * ping-protect-evaluation-callback.ts * - * Copyright (c) 2024 ForgeRock. All rights reserved. + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-initialize-callback.test.ts b/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-initialize-callback.test.ts index a8030f5c9..ea0dfea89 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-initialize-callback.test.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-initialize-callback.test.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * ping-protect-intitialize-callback.test.ts + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { vi, describe, expect, it } from 'vitest'; import { CallbackType } from '../../auth/enums'; import PingOneProtectInitializeCallback from './ping-protect-initialize-callback'; diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-initialize-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-initialize-callback.ts index 7f96bc6d6..ad829aa80 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-initialize-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/ping-protect-initialize-callback.ts @@ -3,7 +3,7 @@ * * ping-protect-initialize-callback.ts * - * Copyright (c) 2024 ForgeRock. All rights reserved. + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/polling-wait-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/polling-wait-callback.ts index 3441be154..0835e7df3 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/polling-wait-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/polling-wait-callback.ts @@ -3,7 +3,7 @@ * * polling-wait-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-callback.ts index 498f4f269..49e557bb6 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-callback.ts @@ -3,7 +3,7 @@ * * recaptcha-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-enterprise-callback.test.ts b/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-enterprise-callback.test.ts index c9080fa41..c63bc4518 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-enterprise-callback.test.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-enterprise-callback.test.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * recaptcha-enterprise-callback.test.ts + * + * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { describe, expect, it, beforeAll } from 'vitest'; import ReCaptchaEnterpriseCallback from './recaptcha-enterprise-callback'; import { CallbackType } from '../../auth/enums'; diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-enterprise-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-enterprise-callback.ts index fb3f4e7aa..770f8a870 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-enterprise-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/recaptcha-enterprise-callback.ts @@ -3,7 +3,7 @@ * * recaptcha-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/redirect-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/redirect-callback.ts index c4851382c..6eb167bdf 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/redirect-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/redirect-callback.ts @@ -3,7 +3,7 @@ * * redirect-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/select-idp-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/select-idp-callback.ts index a67823b14..2340b7226 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/select-idp-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/select-idp-callback.ts @@ -3,7 +3,7 @@ * * select-idp-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/suspended-text-output-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/suspended-text-output-callback.ts index 55ec03b92..e102df3c8 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/suspended-text-output-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/suspended-text-output-callback.ts @@ -3,7 +3,7 @@ * * suspended-text-output-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/terms-and-conditions-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/terms-and-conditions-callback.ts index 2b4fc4d4f..ee8163e58 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/terms-and-conditions-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/terms-and-conditions-callback.ts @@ -3,7 +3,7 @@ * * terms-and-conditions-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/text-input-callback.test.ts b/packages/javascript-sdk/src/fr-auth/callbacks/text-input-callback.test.ts index 18b0679df..5280d2c8c 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/text-input-callback.test.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/text-input-callback.test.ts @@ -3,7 +3,7 @@ * * attribute-input-callback.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/text-input-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/text-input-callback.ts index 4b9c4dfc9..58db6a1e4 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/text-input-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/text-input-callback.ts @@ -3,7 +3,7 @@ * * text-input-callback.ts * - * Copyright (c) 2022 ForgeRock. All rights reserved. + * Copyright (c) 2022 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/text-output-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/text-output-callback.ts index 025f7a9a3..6579ca616 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/text-output-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/text-output-callback.ts @@ -3,7 +3,7 @@ * * text-output-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-password-callback.test.ts b/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-password-callback.test.ts index ccfe67cd6..cf6ef2fb5 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-password-callback.test.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-password-callback.test.ts @@ -3,7 +3,7 @@ * * validated-create-password-callback.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-password-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-password-callback.ts index f36d1395f..39ef422d8 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-password-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-password-callback.ts @@ -3,7 +3,7 @@ * * validated-create-password-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-username-callback.test.ts b/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-username-callback.test.ts index 5eed99631..ae6fe89a1 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-username-callback.test.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-username-callback.test.ts @@ -3,7 +3,7 @@ * * validated-create-username-callback.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-username-callback.ts b/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-username-callback.ts index 7e8f8fa1a..127662a91 100644 --- a/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-username-callback.ts +++ b/packages/javascript-sdk/src/fr-auth/callbacks/validated-create-username-callback.ts @@ -3,7 +3,7 @@ * * validated-create-username-callback.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/enums.ts b/packages/javascript-sdk/src/fr-auth/enums.ts index b031a864e..35b5b2f64 100644 --- a/packages/javascript-sdk/src/fr-auth/enums.ts +++ b/packages/javascript-sdk/src/fr-auth/enums.ts @@ -3,7 +3,7 @@ * * enums.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/fr-login-failure.ts b/packages/javascript-sdk/src/fr-auth/fr-login-failure.ts index 76d353a4c..3ea8face9 100644 --- a/packages/javascript-sdk/src/fr-auth/fr-login-failure.ts +++ b/packages/javascript-sdk/src/fr-auth/fr-login-failure.ts @@ -3,7 +3,7 @@ * * fr-login-failure.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/fr-login-success.ts b/packages/javascript-sdk/src/fr-auth/fr-login-success.ts index 88acd639e..171a1ef6a 100644 --- a/packages/javascript-sdk/src/fr-auth/fr-login-success.ts +++ b/packages/javascript-sdk/src/fr-auth/fr-login-success.ts @@ -3,7 +3,7 @@ * * fr-login-success.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/fr-step.ts b/packages/javascript-sdk/src/fr-auth/fr-step.ts index ba987f22f..a2926c3fc 100644 --- a/packages/javascript-sdk/src/fr-auth/fr-step.ts +++ b/packages/javascript-sdk/src/fr-auth/fr-step.ts @@ -3,7 +3,7 @@ * * fr-step.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/index.ts b/packages/javascript-sdk/src/fr-auth/index.ts index 5d783edf5..65b8f2801 100644 --- a/packages/javascript-sdk/src/fr-auth/index.ts +++ b/packages/javascript-sdk/src/fr-auth/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-auth/interfaces.ts b/packages/javascript-sdk/src/fr-auth/interfaces.ts index 2de0f3ff8..10edc3097 100644 --- a/packages/javascript-sdk/src/fr-auth/interfaces.ts +++ b/packages/javascript-sdk/src/fr-auth/interfaces.ts @@ -3,7 +3,7 @@ * * interfaces.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-device/collector.ts b/packages/javascript-sdk/src/fr-device/collector.ts index 7e37f037f..a253d4b30 100644 --- a/packages/javascript-sdk/src/fr-device/collector.ts +++ b/packages/javascript-sdk/src/fr-device/collector.ts @@ -3,7 +3,7 @@ * * collector.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-device/defaults.ts b/packages/javascript-sdk/src/fr-device/defaults.ts index 9b6d6a027..c239c0d32 100644 --- a/packages/javascript-sdk/src/fr-device/defaults.ts +++ b/packages/javascript-sdk/src/fr-device/defaults.ts @@ -3,7 +3,7 @@ * * defaults.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-device/device-profile.mock.data.ts b/packages/javascript-sdk/src/fr-device/device-profile.mock.data.ts index 7227fe0dc..680d277f3 100644 --- a/packages/javascript-sdk/src/fr-device/device-profile.mock.data.ts +++ b/packages/javascript-sdk/src/fr-device/device-profile.mock.data.ts @@ -3,7 +3,7 @@ * * device-profile.mock.data.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-device/device-profile.test.ts b/packages/javascript-sdk/src/fr-device/device-profile.test.ts index 93128bbfe..dc029d9f0 100644 --- a/packages/javascript-sdk/src/fr-device/device-profile.test.ts +++ b/packages/javascript-sdk/src/fr-device/device-profile.test.ts @@ -3,7 +3,7 @@ * * device-profile.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-device/index.ts b/packages/javascript-sdk/src/fr-device/index.ts index a67b2d437..507a93de6 100644 --- a/packages/javascript-sdk/src/fr-device/index.ts +++ b/packages/javascript-sdk/src/fr-device/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-device/interfaces.ts b/packages/javascript-sdk/src/fr-device/interfaces.ts index dbb2e0003..edbdc9c3a 100644 --- a/packages/javascript-sdk/src/fr-device/interfaces.ts +++ b/packages/javascript-sdk/src/fr-device/interfaces.ts @@ -3,7 +3,7 @@ * * interfaces.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-policy/enums.ts b/packages/javascript-sdk/src/fr-policy/enums.ts index d12489ed2..ce1acaaf1 100644 --- a/packages/javascript-sdk/src/fr-policy/enums.ts +++ b/packages/javascript-sdk/src/fr-policy/enums.ts @@ -3,7 +3,7 @@ * * enums.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-policy/fr-policy.test.ts b/packages/javascript-sdk/src/fr-policy/fr-policy.test.ts index ea66db6ea..20713b1dd 100644 --- a/packages/javascript-sdk/src/fr-policy/fr-policy.test.ts +++ b/packages/javascript-sdk/src/fr-policy/fr-policy.test.ts @@ -3,7 +3,7 @@ * * fr-policy.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-policy/helpers.ts b/packages/javascript-sdk/src/fr-policy/helpers.ts index 6803f8534..3c6eb6f9f 100644 --- a/packages/javascript-sdk/src/fr-policy/helpers.ts +++ b/packages/javascript-sdk/src/fr-policy/helpers.ts @@ -3,7 +3,7 @@ * * helpers.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-policy/index.ts b/packages/javascript-sdk/src/fr-policy/index.ts index c773c583e..0b6df6031 100644 --- a/packages/javascript-sdk/src/fr-policy/index.ts +++ b/packages/javascript-sdk/src/fr-policy/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-policy/interfaces.ts b/packages/javascript-sdk/src/fr-policy/interfaces.ts index 6d1bf868f..a99d59a91 100644 --- a/packages/javascript-sdk/src/fr-policy/interfaces.ts +++ b/packages/javascript-sdk/src/fr-policy/interfaces.ts @@ -3,7 +3,7 @@ * * interfaces.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-policy/message-creator.ts b/packages/javascript-sdk/src/fr-policy/message-creator.ts index b8315f8c0..52916369f 100644 --- a/packages/javascript-sdk/src/fr-policy/message-creator.ts +++ b/packages/javascript-sdk/src/fr-policy/message-creator.ts @@ -3,7 +3,7 @@ * * message-creator.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-qr-code/index.mock.data.ts b/packages/javascript-sdk/src/fr-qr-code/index.mock.data.ts index f1c9db7e0..c9440070b 100644 --- a/packages/javascript-sdk/src/fr-qr-code/index.mock.data.ts +++ b/packages/javascript-sdk/src/fr-qr-code/index.mock.data.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * index.mock.data.ts + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { CallbackType } from '../auth/enums'; export const otpQRCodeStep = { diff --git a/packages/javascript-sdk/src/fr-qr-code/index.test.ts b/packages/javascript-sdk/src/fr-qr-code/index.test.ts index a2ce2728f..f57096624 100644 --- a/packages/javascript-sdk/src/fr-qr-code/index.test.ts +++ b/packages/javascript-sdk/src/fr-qr-code/index.test.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * index.test.ts + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import FRStep from '../fr-auth/fr-step'; import FRQRCode from './index'; import { otpQRCodeStep, pushQRCodeStep } from './index.mock.data'; diff --git a/packages/javascript-sdk/src/fr-qr-code/index.ts b/packages/javascript-sdk/src/fr-qr-code/index.ts index b14f0ee3a..e3e7449b3 100644 --- a/packages/javascript-sdk/src/fr-qr-code/index.ts +++ b/packages/javascript-sdk/src/fr-qr-code/index.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * index.ts + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { CallbackType } from '../auth/enums'; import HiddenValueCallback from '../fr-auth/callbacks/hidden-value-callback'; import TextOutputCallback from '../fr-auth/callbacks/text-output-callback'; diff --git a/packages/javascript-sdk/src/fr-recovery-codes/index.ts b/packages/javascript-sdk/src/fr-recovery-codes/index.ts index 7b67ea8a5..e0db1569b 100644 --- a/packages/javascript-sdk/src/fr-recovery-codes/index.ts +++ b/packages/javascript-sdk/src/fr-recovery-codes/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-recovery-codes/recovery-codes.test.ts b/packages/javascript-sdk/src/fr-recovery-codes/recovery-codes.test.ts index ab59402be..bfc971682 100644 --- a/packages/javascript-sdk/src/fr-recovery-codes/recovery-codes.test.ts +++ b/packages/javascript-sdk/src/fr-recovery-codes/recovery-codes.test.ts @@ -3,7 +3,7 @@ * * recovery-codes.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-recovery-codes/script-parser.test.ts b/packages/javascript-sdk/src/fr-recovery-codes/script-parser.test.ts index f3bcc5bac..b9420a427 100644 --- a/packages/javascript-sdk/src/fr-recovery-codes/script-parser.test.ts +++ b/packages/javascript-sdk/src/fr-recovery-codes/script-parser.test.ts @@ -3,7 +3,7 @@ * * script-parser.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-recovery-codes/script-parser.ts b/packages/javascript-sdk/src/fr-recovery-codes/script-parser.ts index 92ef8fbd3..bce108da9 100644 --- a/packages/javascript-sdk/src/fr-recovery-codes/script-parser.ts +++ b/packages/javascript-sdk/src/fr-recovery-codes/script-parser.ts @@ -3,7 +3,7 @@ * * script-parser.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-recovery-codes/script-text.mock.data.ts b/packages/javascript-sdk/src/fr-recovery-codes/script-text.mock.data.ts index 89b953020..f5eda7b2a 100644 --- a/packages/javascript-sdk/src/fr-recovery-codes/script-text.mock.data.ts +++ b/packages/javascript-sdk/src/fr-recovery-codes/script-text.mock.data.ts @@ -4,7 +4,7 @@ * * script-text.mock.data.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-user/index.ts b/packages/javascript-sdk/src/fr-user/index.ts index c69054aa6..74b715d66 100644 --- a/packages/javascript-sdk/src/fr-user/index.ts +++ b/packages/javascript-sdk/src/fr-user/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -16,7 +16,9 @@ import OAuth2Client from '../oauth2-client'; import SessionManager from '../session-manager'; import TokenManager from '../token-manager'; import type { LogoutOptions } from '../oauth2-client/interfaces'; +import Config from '../config'; import TokenStorage from '../token-storage'; +import { getEndpointPath } from '../util/url'; /** * High-level API for logging a user in/out and getting profile information. @@ -47,13 +49,25 @@ abstract class FRUser { // Shallow copy options to delete redirect prop const configOptions = { ...options }; delete configOptions.redirect; + const { realmPath, serverConfig } = Config.get(configOptions); - // Just log any exceptions that are thrown, but don't abandon the flow - try { - // Both invalidates the session on the server AND removes browser cookie - await SessionManager.logout(configOptions); - } catch (error) { - FRLogger.warn('Session logout was not successful'); + if (getEndpointPath('sessions', realmPath, serverConfig.paths)) { + // Just log any exceptions that are thrown, but don't abandon the flow + try { + // Both invalidates the session on the server AND removes browser cookie + await SessionManager.logout(configOptions); + } catch (error) { + FRLogger.warn('Session logout was not successful'); + } + } + + if (options?.redirect === false) { + try { + // Invalidates session on the server tied to the ID Token + await OAuth2Client.endSession({ ...options }); + } catch (error) { + FRLogger.warn('OAuth endSession was not successful'); + } } try { @@ -69,14 +83,13 @@ abstract class FRUser { // Remove tokens locally await TokenManager.deleteTokens(); - // Do this last as it can result in a redirect if using PingOne - try { - // Invalidates session on the server tied to the ID Token - // Needed for Express environment as session logout is unavailable - // Pass in the original `options` as it's needed for redirect control - await OAuth2Client.endSession({ ...options, idToken }); - } catch (error) { - FRLogger.warn('OAuth endSession was not successful'); + if (options?.redirect !== false) { + try { + // Pass in the original `options` as it's needed for redirect control + await OAuth2Client.endSession({ ...options, idToken }); + } catch (error) { + FRLogger.warn('OAuth endSession was not successful'); + } } } } diff --git a/packages/javascript-sdk/src/fr-webauthn/enums.ts b/packages/javascript-sdk/src/fr-webauthn/enums.ts index 41afa8d57..13f4c7c09 100644 --- a/packages/javascript-sdk/src/fr-webauthn/enums.ts +++ b/packages/javascript-sdk/src/fr-webauthn/enums.ts @@ -3,7 +3,7 @@ * * enums.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-webauthn/fr-webauthn.mock.data.ts b/packages/javascript-sdk/src/fr-webauthn/fr-webauthn.mock.data.ts index 72e7c2794..98b6df6e7 100644 --- a/packages/javascript-sdk/src/fr-webauthn/fr-webauthn.mock.data.ts +++ b/packages/javascript-sdk/src/fr-webauthn/fr-webauthn.mock.data.ts @@ -3,7 +3,7 @@ * * fr-webauthn.mock.data.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -373,3 +373,119 @@ export const webAuthnAuthMetaCallback70StoredUsername = { }, ], }; + +export const webAuthnAuthMetaCallbackJsonResponse = { + authId: + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdXRoSW5kZXhWYWx1ZSI6IndlYmF1dGhuIiwib3RrIjoicXN1dTA0anNxZ2hmcGpubjFiM2IxdDh0NTQiLCJhdXRoSW5kZXhUeXBlIjoic2VydmljZSIsInJlYWxtIjoiLyIsInNlc3Npb25JZCI6IipBQUpUU1FBQ01ERUFCSFI1Y0dVQUNFcFhWRjlCVlZSSUFBSlRNUUFBKmV5SjBlWEFpT2lKS1YxUWlMQ0pqZEhraU9pSktWMVFpTENKaGJHY2lPaUpJVXpJMU5pSjkuWlhsS01HVllRV2xQYVVwTFZqRlJhVXhEU214aWJVMXBUMmxLUWsxVVNUUlJNRXBFVEZWb1ZFMXFWVEpKYVhkcFdWZDRia2xxYjJsYVIyeDVTVzR3TGk0M01qbDZSRXhsU0hwM1pXbFVPRll6VDB4cFgycEJMbGxpV1Y5WVl6WTJPVWxJU0MxT01VTk5Va05MZVROdFZFaHliVlJSVDJoV2VVSTBUVUUzYUVoRmFISjFTRU5SVWpWeWVsQnRZVzFpYlRNeFFqQlhSMlZxVEU5allUWllWMEUwTVROSlozRnVXV2gwV0hadlRHaE9VMkpDYUdkUlJFaGFSV1pLVmxaeWNsOTBTRUpJU1Y5elIyMVhNMEZYWm5wTk9WZElXblJMTm10ZmFITm9hemRNUTBkSVkwbzVhVGQ2Wnpob2FUbFROVm8wTVVkbk1rZFpXSFJJTnpoWlRGOVVaVTl5VWtOc1ozTlBkbDlWTWpGRFJ6STBReTFMWVRJNVMxRm9ibFYwTTNCVlozWldiamRCVUhWdWRFdEdaR2h6VERselJ6QlBTVnAwYzNoV1NqTXRPVmc1TmpSM2VrVldSV2w2Vnprek9XNTRlVm94VjNWVVgzWmpTRzFFV2t4eE0yWTJXamswVlVWTU5VNDJjMjVMTWs5U01XeDBOR3BrVld3eWVVMVRaVXR6YzJkb2VIRmlNMnhoZW1WQlVtMDBWM3BUVld4c1JFUTRVVVJuWDNoSFozSktlVmhQZWxCa1RWUnZYeTB0U1c0MFkxVjBTeloxTVdWSVkxOWhZbkZLTlhsRVpWcEpaM04yYkU5eE5qVTJkVU5KV0dzNU9GbElWMHBEWkhSR1MzcGtWV1k1ZG0xNlJIWk9iMmxXTlZnd2RXd3hiRzlTV0dOaFZtTkhVMDlaTlVGNFdITkJkSGd5UVhkVlVXUnViR0pmYTJodWN5MUhXblowZUVOM1lYRldlR2h1T1RsdVVWY3ljWFphUjNCTk1raFVPRzFMYUU5SVIyOVJOQzFWVkZrNVVWbDBNbGcwZGpaZlQzSk5kemxUZEdwSVl6RnRjMTkxVTI1VWVtVmpUR2RYUkVZdFVFNXNVM0J1Ymkxc1EyRlljRXREVmxsS1FVeDVUbWhoWDBJeGQwNTRSRzV0WW5vNVdYVjFXakZMYzFWTkxVZHJjVlJZYkY5c2JqUlBMVEpXVUhoTVFYSjFVblZOZW0xaVgxQndRMjlqY1d4T1Z6Sm1jWHBPV25seVlteE9RVEZXUkdaM04yYzJNMnhmTkhvd05UWkhlRXhOVjBOck5rOTZVQzFMY1RJMVlXTmxSa0ZQWWpGd1JtMXBkVGgzWW5kUGVITmtZa0ZLVW0xSWMxVlJWVzlQWm5aQlpURldORmcyUW5veGNFeG9SV3d0UzNGblkwMDBjMjluYTFab1YyRkhZWFpyVFUxSVFTNVlWRVpOV1d4R2F6bHFSV1V5VG5CamFIZDVZVzVuLmYyS2t1RlhnM05MUU1NbGNnMU1HU2Y2YTZQVmdJalhtUC1wcmJhQTNtTnciLCJleHAiOjE2MTM0OTc0OTksImlhdCI6MTYxMzQ5NzE5OX0.EuDmsY3C6I6vc_x7KlkW4rSQJY1FWevbGGmxkSu4HVU', + callbacks: [ + { + type: 'MetadataCallback', + output: [ + { + name: 'data', + value: { + _action: 'webauthn_authentication', + challenge: 'qnMsxgya8h6mUc6OyRu8jJ6Oq16tHV3cgE7juXGMDbg=', + allowCredentials: '', + _allowCredentials: [], + timeout: '60000', + userVerification: 'preferred', + relyingPartyId: 'rpId: "humorous-cuddly-carrot.glitch.me",', + _relyingPartyId: 'humorous-cuddly-carrot.glitch.me', + _type: 'WebAuthn', + supportsJsonResponse: true, + }, + }, + ], + }, + { + type: 'HiddenValueCallback', + output: [ + { + name: 'value', + value: 'false', + }, + { + name: 'id', + value: 'webAuthnOutcome', + }, + ], + input: [ + { + name: 'IDToken2', + value: 'webAuthnOutcome', + }, + ], + }, + ], +}; + +export const webAuthnRegMetaCallbackJsonResponse = { + authId: + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ3aGl0ZWxpc3Qtc3RhdGUiOiJjMjMzNDRkMC04ZTlhLTRhM2QtODZkMS1mNTIwNTExZmM3NjciLCJhdXRoSW5kZXhWYWx1ZSI6IkFuZHlXZWJBdXRobiIsIm90ayI6ImFzdTNjMmo4YThta2w0aWQyN3FndGFuaTVqIiwiYXV0aEluZGV4VHlwZSI6InNlcnZpY2UiLCJyZWFsbSI6Ii9hbHBoYSIsInNlc3Npb25JZCI6IipBQUpUU1FBQ01ESUFCSFI1Y0dVQUNFcFhWRjlCVlZSSUFBSlRNUUFDTURFLipleUowZVhBaU9pSktWMVFpTENKamRIa2lPaUpLVjFRaUxDSmhiR2NpT2lKSVV6STFOaUo5LlpYbEtNR1ZZUVdsUGFVcExWakZSYVV4RFNteGliVTFwVDJsS1FrMVVTVFJSTUVwRVRGVm9WRTFxVlRKSmFYZHBXVmQ0YmtscWIybGFSMng1U1c0d0xpNVJkVXBMWTBnNGIwUjViemxZV0ZKcE0wNDJjQzFCTG0xRU0xOWFOVlZrZURGeVYxUk9lR2MwVUVWNFNHMW1OMGN5TkdoSU1YRXpPV0ZhVDNoaWREbFlUa000VEZscU1VRm1la1pXUzBkME1ubEJVMmxvT1hCNmJIRjNOVTQ0Y0ZsblZXRnplV2g1VEdWUFdtWldaVkpqVldNMmNGRjJOVmxhZEROdGNHWnZOMWRuV1hsWVNrRnZRWGQxZEhka2NYVlhaVXBYWkRScVl6TlBkRTFOTlVOV1NWaGtTRFZqVURGTVlrRjVTblJHWVd4NlIyWkplVGRtWW0xQll6SkZTbGxLUVdGNFZqTTRSa0l0TjFWVFFWZEVaMWxsUW14elYzQXRjWEZSYlRSdFIyUnBkRlpwYzBFdGNWRTFUbEpaU0cxQlJXSnpVVXBtWVdoRVQzSllUMFo1ZVZNM2VUUnVaV3BHUjNaWExVaFFRV054YjJ0TGNFMWZhVFkyWVRrdFZrbE9UMWxaY0RoWFQxaFFiR2hVTWt4YVIwVk1SVEpuVUhsWFkzcDJNV2xCVjBwcU4zVlVjVWx2UjFCTllVNUxSSEJKZGpaTk4wdFphVnA2YzJoUE9IRmxTMWw1VjJ3emNWWk9Tek4wWjJOamNGbERZVkJmT0ZGcGNuZG9iMkV3UjNOSWRIRk9SR04yYlhCUldIbE1ZM1Z3VGpkdmJGbDNhREV5WlVsTU9HaEZla0pLUldkMlVFaGpTM0JDYmxKVVYwOWlkemhJUlZobFJFZzRNbGxDWmxJdGVXMXpYMjlZT0c1dFpURldhbFJvUVZnMlRHZGtkbkUwVTJ4MmJYVjFYMTlzZVZack9GQnVZV3RDTldvMWVHOUtkVkUwTjFwRlZERnBUbGsxVkhCQlVHNUNOMjVuVVhaeWExRnlWR1ZHZFZKdU1EUlFPV1E0TTJ0MFVXcEhaMlpyUVdkbVNrNWpiek54YUZOR1dGb3dWM2swWldkUlpHdGhUVFU0ZGxSVVJtRlhlRjl1VERkdk9XdGFha3hXUjA4eFh6Sk9Oa0ZGVW5SVWFpMU9MVll6UmxwMlJYTnpRbnBTV1V0V2VGUm5UMTlRUTNWVmMxaDJjVzFVU1ZkcFNUQnhYekE0ZFhSVlVXcGpRMHhWUjNCVlZHRnVhR0pCVldKV1R6SnZVWHBVVTJ4bkxUTTJhakJWZVMxdlYxQTVNblo0ZVhvMWRUSkZkRVpwWkRaRGMxWmFMVVl3TFdkbWNFTnBkUzFGVlVzNFJITklhelZCUXpFNVp6VnRNMkY0Tmw5TFZuTlBkMmxIWDIxMU5tcHhOVzlsTlhkbFFtVm9iRE5RV0ZCTmFERTRTRWRrTTFOVVRHUmphVjl0VXpKTFJuYzJTM2xvWVd0a1dIcElXREZSTFdwRVIzWkRlRzF4YzJGcFZuUllhVlJSTXpSM1pVdGFhRk15VEVSVVpITklWM0JZTFdReFREa3lSMlJrVFc1UGJWRkhlV3A0WkRScU16TlFPVW96TVdGNGMyVXhZbDlFY1MxeWFXZHZZM2huTG1wR2VXWmxRVTlRVjBwMldUaHNaV3B1Wm1RemIyYy43YmdYcE5RNGRLSEpTeGpmUEVZZm44MGxZc3owaXBwNngyaURtRXlqd1JjIiwiZXhwIjoxNzQyODQzMDQ4LCJpYXQiOjE3NDI4NDI3NDh9.3zuPwPZVeFSwezhmzSZe-HW-22zo1HXwEPJO5jGl0Cg', + callbacks: [ + { + type: 'MetadataCallback', + output: [ + { + name: 'data', + value: { + _action: 'webauthn_registration', + challenge: 'QMmVc2lSU6G+jx6IYNOd6EaPz6X8jBzkxI9TMdVyWTw=', + attestationPreference: 'none', + userName: 'demo', + userId: 'NzcyNTI2NmMtYmZiZi00ZGFiLWFhYzEtNjY3NjUyMGIzNmZl', + relyingPartyName: 'ForgeRock', + authenticatorSelection: + '{"userVerification":"preferred","residentKey":"required","requireResidentKey":true}', + _authenticatorSelection: { + userVerification: 'preferred', + residentKey: 'required', + requireResidentKey: true, + }, + pubKeyCredParams: + '[ { "type": "public-key", "alg": -257 }, { "type": "public-key", "alg": -7 } ]', + _pubKeyCredParams: [ + { + type: 'public-key', + alg: -257, + }, + { + type: 'public-key', + alg: -7, + }, + ], + timeout: '60000', + excludeCredentials: '', + _excludeCredentials: [], + displayName: 'demo', + relyingPartyId: 'id: "idc.petrov.ca",', + _relyingPartyId: 'idc.petrov.ca', + extensions: {}, + _type: 'WebAuthn', + supportsJsonResponse: true, + }, + }, + ], + }, + { + type: 'HiddenValueCallback', + output: [ + { + name: 'value', + value: 'false', + }, + { + name: 'id', + value: 'webAuthnOutcome', + }, + ], + input: [ + { + name: 'IDToken2', + value: 'webAuthnOutcome', + }, + ], + }, + ], +}; diff --git a/packages/javascript-sdk/src/fr-webauthn/fr-webauthn.test.ts b/packages/javascript-sdk/src/fr-webauthn/fr-webauthn.test.ts index b3ec84116..d14d17941 100644 --- a/packages/javascript-sdk/src/fr-webauthn/fr-webauthn.test.ts +++ b/packages/javascript-sdk/src/fr-webauthn/fr-webauthn.test.ts @@ -3,7 +3,7 @@ * * fr-webauthn.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-webauthn/helpers.mock.data.ts b/packages/javascript-sdk/src/fr-webauthn/helpers.mock.data.ts index d8526f0ea..8e0dd24d7 100644 --- a/packages/javascript-sdk/src/fr-webauthn/helpers.mock.data.ts +++ b/packages/javascript-sdk/src/fr-webauthn/helpers.mock.data.ts @@ -3,18 +3,23 @@ * * helpers.mock.data.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ // eslint-disable-next-line -export const allowCredentials70 = 'allowCredentials: [{ "type": "public-key", "id": new Int8Array([1, -16, 9, 79, 6, -2, -82, 51, 124, -94, 95, 23, -86, 70, -43, 89, 91, -9, 45, -22, 91, -51, 84, 93, 24, -64, 38, 101, 126, -53, 87, 70, -49, -88, -105, 116, 33, 75, -39, -92, -5, 115, 12, 52, 124, -100, 85, 104, -15, 5, -13, 25, -74, 101, 71, -115, -102, 16, 10, -9, -19, -110, 65, 118, -28, 89, -15, -115, -81, 22, -104, 123, 17, -92, 49, 109, -38, -51, 100, 96, -65, 25, -48, 28, 106, -45, 17, -45, -37, 46, -5, -6, -26, -23, -108, 13, -66, -55, -117, -107, 119, 7, -32, 34, 46, 0, -29, -111, -32, 45, -15, -113, 110, 123, -44, 6, 10, 65, 99, 25, 105, 69, -127, 76, 127, -33, -89, -56, 74, 25, 43, -43, -56, 9, 87, 80, 124, -32, -39, 115, 17, 18, 78, 121, 69, -36, -44, -28, -109, -126, 58, 64, 80, -4, 21, 63, -19]).buffer }]'; +export const allowCredentials70 = + 'allowCredentials: [{ "type": "public-key", "id": new Int8Array([1, -16, 9, 79, 6, -2, -82, 51, 124, -94, 95, 23, -86, 70, -43, 89, 91, -9, 45, -22, 91, -51, 84, 93, 24, -64, 38, 101, 126, -53, 87, 70, -49, -88, -105, 116, 33, 75, -39, -92, -5, 115, 12, 52, 124, -100, 85, 104, -15, 5, -13, 25, -74, 101, 71, -115, -102, 16, 10, -9, -19, -110, 65, 118, -28, 89, -15, -115, -81, 22, -104, 123, 17, -92, 49, 109, -38, -51, 100, 96, -65, 25, -48, 28, 106, -45, 17, -45, -37, 46, -5, -6, -26, -23, -108, 13, -66, -55, -117, -107, 119, 7, -32, 34, 46, 0, -29, -111, -32, 45, -15, -113, 110, 123, -44, 6, 10, 65, 99, 25, 105, 69, -127, 76, 127, -33, -89, -56, 74, 25, 43, -43, -56, 9, 87, 80, 124, -32, -39, 115, 17, 18, 78, 121, 69, -36, -44, -28, -109, -126, 58, 64, 80, -4, 21, 63, -19]).buffer }]'; // eslint-disable-next-line -export const allowMultipleCredentials70 = 'allowCredentials: [{ "type": "public-key", "id": new Int8Array([-33, 120, 18, 124, 16, 5, -127, -51, 68, 85, 76, -92, -3, 25, 116, 91, 71, 53, 106, -114, -86, 9, -81, -96, -32, -110, 66, -23, -5, 104, 96, 46, 43, -66, -110, 8, -70, 11, 51, -93, 19, 124, 81, 78, 58, -97, 89, -87, -26, -112, 95, -83, 118, -25, 118, 3, 35, -96, 120, -76, -87, 83, -101, 82]).buffer },{ "type": "public-key", "id": new Int8Array([1, 73, 82, 23, 76, -5, -53, -48, -104, -17, -42, 45, 7, 35, 35, -72, -7, 37, 9, 37, 117, 42, 66, 116, 58, 25, -68, 53, 113, -10, 102, 3, -60, -81, -74, 96, -5, 111, -56, 110, -101, -54, -31, -123, -100, 3, 37, -69, -114, -19, -25, -62, 18, 122, 39, 11, 83, 60, -58, 3, 116, 10, -80, -35, 6, -128, -51, -92, 100, -115, -22, -122, 21, -65, 97, 67, -49, 26, 42, -11, 90, 121, -63, 112, -16, 118, -99, -73, -89, -67, 72, -80, 18, -72, 109, 4, -14, 1, -93, 17, -17, -70, -2, -5, -116, 111, -128, 7, 62, -34, -43, 110, 89, 113, -65, -95, 113, -5, -104, -100, -73, 42, 2, 112, -21, 41, 41, 91, 108, -102, 47, -77, -52, 70, 107, -4, 25, -120, 114, 30, 23, 103, 120, 17, 55, 91, -110, -58, -110, 13, -56, 57, -126, 36, 40, 89, -9]).buffer }]' +export const allowMultipleCredentials70 = + 'allowCredentials: [{ "type": "public-key", "id": new Int8Array([-33, 120, 18, 124, 16, 5, -127, -51, 68, 85, 76, -92, -3, 25, 116, 91, 71, 53, 106, -114, -86, 9, -81, -96, -32, -110, 66, -23, -5, 104, 96, 46, 43, -66, -110, 8, -70, 11, 51, -93, 19, 124, 81, 78, 58, -97, 89, -87, -26, -112, 95, -83, 118, -25, 118, 3, 35, -96, 120, -76, -87, 83, -101, 82]).buffer },{ "type": "public-key", "id": new Int8Array([1, 73, 82, 23, 76, -5, -53, -48, -104, -17, -42, 45, 7, 35, 35, -72, -7, 37, 9, 37, 117, 42, 66, 116, 58, 25, -68, 53, 113, -10, 102, 3, -60, -81, -74, 96, -5, 111, -56, 110, -101, -54, -31, -123, -100, 3, 37, -69, -114, -19, -25, -62, 18, 122, 39, 11, 83, 60, -58, 3, 116, 10, -80, -35, 6, -128, -51, -92, 100, -115, -22, -122, 21, -65, 97, 67, -49, 26, 42, -11, 90, 121, -63, 112, -16, 118, -99, -73, -89, -67, 72, -80, 18, -72, 109, 4, -14, 1, -93, 17, -17, -70, -2, -5, -116, 111, -128, 7, 62, -34, -43, 110, 89, 113, -65, -95, 113, -5, -104, -100, -73, 42, 2, 112, -21, 41, 41, 91, 108, -102, 47, -77, -52, 70, 107, -4, 25, -120, 114, 30, 23, 103, 120, 17, 55, 91, -110, -58, -110, 13, -56, 57, -126, 36, 40, 89, -9]).buffer }]'; // eslint-disable-next-line -export const acceptableCredentials653 = '{ "type": "public-key", "id": new Int8Array([53, -21, 26, -99, 5, 4, -112, -76, -126, 90, -35, -7, -31, -92, 19, -71, -39, 73, 52, -10, -14, -7, -59, -7, -36, -111, 64, 101, 29, 89, 90, -56, 108, 42, 32, -19, -113, 118, -114, 49, 109, -70, 68, -89, 36, -36, -103, -128, 34, -24, -40, -71, -125, -120, -80, 63, 25, -33, 2, 26, 111, -52, -15, -52]).buffer }'; +export const acceptableCredentials653 = + '{ "type": "public-key", "id": new Int8Array([53, -21, 26, -99, 5, 4, -112, -76, -126, 90, -35, -7, -31, -92, 19, -71, -39, 73, 52, -10, -14, -7, -59, -7, -36, -111, 64, 101, 29, 89, 90, -56, 108, 42, 32, -19, -113, 118, -114, 49, 109, -70, 68, -89, 36, -36, -103, -128, 34, -24, -40, -71, -125, -120, -80, 63, 25, -33, 2, 26, 111, -52, -15, -52]).buffer }'; // eslint-disable-next-line -export const acceptableMultipleCredentials653 = '{ "type": "public-key", "id": new Int8Array([17, 88, -12, 26, -50, -48, -38, 36, -69, -105, -68, -38, 66, -53, -37, -50, -109, -126, 122, 26, 25, -45, 96, 37, -124, 102, 124, 94, -98, -59, 113, 94, 115, -111, -69, 45, 37, -83, 118, -115, -4, -49, 34, 115, -24, -49, -37, -17, -127, -15, 62, 18, 93, 122, -109, 53, -52, 44, -63, -74, 109, 2, -110, 45]).buffer },{ "type": "public-key", "id": new Int8Array([1, 83, -98, 32, 110, -62, 78, 53, -63, -118, 12, 122, -72, -15, 85, 48, -39, -97, -73, 108, -122, -60, 56, -112, -89, -118, 111, 0, -4, 13, -50, -43, -53, 28, 114, 82, 22, -76, 15, 51, -95, 26, -90, -93, -51, 115, -28, 85, -105, -27, 111, 70, 106, -28, 45, 126, 44, 63, -16, 97, -55, 31, -24, 57, -92, 48, 26, 127, -39, 75, 12, 13, 100, -77, 13, -48, 49, 52, 31, 85, 9, 63, -122, -90, -54, -87, -110, -1, 115, -122, -69, -15, 83, 57, 95, -31, -92, -116, 89, -109, -98, 21, 24, -80, -28, 103, -28, -82, -39, 114, -29, -46, -76, 123, -69, -44, 124, 10, 53, -103, 19, -43, -12, 62, -83, -86, 95, -78, 70, -105, 116, -25, 106, 54, -72, -119, 91, 91, -71, -49, 22, 25, -108, 112, -14, 55, 9, 75, 89, -91, -59, 45]).buffer }'; +export const acceptableMultipleCredentials653 = + '{ "type": "public-key", "id": new Int8Array([17, 88, -12, 26, -50, -48, -38, 36, -69, -105, -68, -38, 66, -53, -37, -50, -109, -126, 122, 26, 25, -45, 96, 37, -124, 102, 124, 94, -98, -59, 113, 94, 115, -111, -69, 45, 37, -83, 118, -115, -4, -49, 34, 115, -24, -49, -37, -17, -127, -15, 62, 18, 93, 122, -109, 53, -52, 44, -63, -74, 109, 2, -110, 45]).buffer },{ "type": "public-key", "id": new Int8Array([1, 83, -98, 32, 110, -62, 78, 53, -63, -118, 12, 122, -72, -15, 85, 48, -39, -97, -73, 108, -122, -60, 56, -112, -89, -118, 111, 0, -4, 13, -50, -43, -53, 28, 114, 82, 22, -76, 15, 51, -95, 26, -90, -93, -51, 115, -28, 85, -105, -27, 111, 70, 106, -28, 45, 126, 44, 63, -16, 97, -55, 31, -24, 57, -92, 48, 26, 127, -39, 75, 12, 13, 100, -77, 13, -48, 49, 52, 31, 85, 9, 63, -122, -90, -54, -87, -110, -1, 115, -122, -69, -15, 83, 57, 95, -31, -92, -116, 89, -109, -98, 21, 24, -80, -28, 103, -28, -82, -39, 114, -29, -46, -76, 123, -69, -44, 124, 10, 53, -103, 19, -43, -12, 62, -83, -86, 95, -78, 70, -105, 116, -25, 106, 54, -72, -119, 91, 91, -71, -49, 22, 25, -108, 112, -14, 55, 9, 75, 89, -91, -59, 45]).buffer }'; // eslint-disable-next-line -export const pubKeyCredParamsStr = '[ { "type": "public-key", "alg": -257 }, { "type": "public-key", "alg": -7 } ]'; +export const pubKeyCredParamsStr = + '[ { "type": "public-key", "alg": -257 }, { "type": "public-key", "alg": -7 } ]'; diff --git a/packages/javascript-sdk/src/fr-webauthn/helpers.test.ts b/packages/javascript-sdk/src/fr-webauthn/helpers.test.ts index d31dd7204..15fa4fd34 100644 --- a/packages/javascript-sdk/src/fr-webauthn/helpers.test.ts +++ b/packages/javascript-sdk/src/fr-webauthn/helpers.test.ts @@ -3,7 +3,7 @@ * * helpers.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-webauthn/helpers.ts b/packages/javascript-sdk/src/fr-webauthn/helpers.ts index 428441ee7..fb704760d 100644 --- a/packages/javascript-sdk/src/fr-webauthn/helpers.ts +++ b/packages/javascript-sdk/src/fr-webauthn/helpers.ts @@ -3,7 +3,7 @@ * * helpers.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-webauthn/index.ts b/packages/javascript-sdk/src/fr-webauthn/index.ts index 063f69424..3c697faca 100644 --- a/packages/javascript-sdk/src/fr-webauthn/index.ts +++ b/packages/javascript-sdk/src/fr-webauthn/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2024 Ping Identity. All rights reserved. + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All rights reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. @@ -104,20 +104,28 @@ abstract class FRWebAuthn { const { hiddenCallback, metadataCallback, textOutputCallback } = this.getCallbacks(step); if (hiddenCallback && (metadataCallback || textOutputCallback)) { let outcome: ReturnType; + let credential: PublicKeyCredential | null = null; try { let publicKey: PublicKeyCredentialRequestOptions; if (metadataCallback) { const meta = metadataCallback.getOutputValue('data') as WebAuthnAuthenticationMetadata; publicKey = this.createAuthenticationPublicKey(meta); + + credential = await this.getAuthenticationCredential( + publicKey as PublicKeyCredentialRequestOptions, + ); + outcome = this.getAuthenticationOutcome(credential); } else if (textOutputCallback) { publicKey = parseWebAuthnAuthenticateText(textOutputCallback.getMessage()); + + credential = await this.getAuthenticationCredential( + publicKey as PublicKeyCredentialRequestOptions, + ); + outcome = this.getAuthenticationOutcome(credential); + } else { + throw new Error('No Credential found from Public Key'); } - // TypeScript doesn't like `publicKey` being assigned in conditionals above - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - const credential = await this.getAuthenticationCredential(publicKey); - outcome = this.getAuthenticationOutcome(credential); } catch (error) { if (!(error instanceof Error)) throw error; // NotSupportedError is a special case @@ -129,6 +137,18 @@ abstract class FRWebAuthn { throw error; } + if (metadataCallback) { + const meta = metadataCallback.getOutputValue('data') as WebAuthnAuthenticationMetadata; + if (meta?.supportsJsonResponse && credential && 'authenticatorAttachment' in credential) { + hiddenCallback.setInputValue( + JSON.stringify({ + authenticatorAttachment: credential.authenticatorAttachment, + legacyData: outcome, + }), + ); + return step; + } + } hiddenCallback.setInputValue(outcome); return step; } else { @@ -154,19 +174,20 @@ abstract class FRWebAuthn { const { hiddenCallback, metadataCallback, textOutputCallback } = this.getCallbacks(step); if (hiddenCallback && (metadataCallback || textOutputCallback)) { let outcome: OutcomeWithName; + let credential: PublicKeyCredential | null = null; try { let publicKey: PublicKeyCredentialRequestOptions; if (metadataCallback) { const meta = metadataCallback.getOutputValue('data') as WebAuthnRegistrationMetadata; publicKey = this.createRegistrationPublicKey(meta); - const credential = await this.getRegistrationCredential( + credential = await this.getRegistrationCredential( publicKey as PublicKeyCredentialCreationOptions, ); outcome = this.getRegistrationOutcome(credential); } else if (textOutputCallback) { publicKey = parseWebAuthnRegisterText(textOutputCallback.getMessage()); - const credential = await this.getRegistrationCredential( + credential = await this.getRegistrationCredential( publicKey as PublicKeyCredentialCreationOptions, ); outcome = this.getRegistrationOutcome(credential); @@ -183,6 +204,21 @@ abstract class FRWebAuthn { hiddenCallback.setInputValue(`${WebAuthnOutcome.Error}::${error.name}:${error.message}`); throw error; } + + if (metadataCallback) { + const meta = metadataCallback.getOutputValue('data') as WebAuthnAuthenticationMetadata; + if (meta?.supportsJsonResponse && credential && 'authenticatorAttachment' in credential) { + hiddenCallback.setInputValue( + JSON.stringify({ + authenticatorAttachment: credential.authenticatorAttachment, + legacyData: + deviceName && deviceName.length > 0 ? `${outcome}::${deviceName}` : outcome, + }), + ); + return step; + } + } + hiddenCallback.setInputValue( deviceName && deviceName.length > 0 ? `${outcome}::${deviceName}` : outcome, ); diff --git a/packages/javascript-sdk/src/fr-webauthn/interfaces.ts b/packages/javascript-sdk/src/fr-webauthn/interfaces.ts index de57c7a6d..b78373a59 100644 --- a/packages/javascript-sdk/src/fr-webauthn/interfaces.ts +++ b/packages/javascript-sdk/src/fr-webauthn/interfaces.ts @@ -3,7 +3,7 @@ * * interfaces.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -73,6 +73,7 @@ interface WebAuthnRegistrationMetadata { userId: string; userName: string; displayName?: string; + supportsJsonResponse?: boolean; } interface WebAuthnAuthenticationMetadata { @@ -82,6 +83,7 @@ interface WebAuthnAuthenticationMetadata { relyingPartyId: string; timeout: number; userVerification: UserVerificationType; + supportsJsonResponse?: boolean; } interface WebAuthnCallbacks { diff --git a/packages/javascript-sdk/src/fr-webauthn/script-parser.test.ts b/packages/javascript-sdk/src/fr-webauthn/script-parser.test.ts index 617e26f27..f179c9d11 100644 --- a/packages/javascript-sdk/src/fr-webauthn/script-parser.test.ts +++ b/packages/javascript-sdk/src/fr-webauthn/script-parser.test.ts @@ -3,7 +3,7 @@ * * script-parser.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-webauthn/script-parser.ts b/packages/javascript-sdk/src/fr-webauthn/script-parser.ts index 0c07410f8..2b58927c1 100644 --- a/packages/javascript-sdk/src/fr-webauthn/script-parser.ts +++ b/packages/javascript-sdk/src/fr-webauthn/script-parser.ts @@ -4,7 +4,7 @@ * * script-parser.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/fr-webauthn/script-text.mock.data.ts b/packages/javascript-sdk/src/fr-webauthn/script-text.mock.data.ts index 3cc85e5fd..9a22c381f 100644 --- a/packages/javascript-sdk/src/fr-webauthn/script-text.mock.data.ts +++ b/packages/javascript-sdk/src/fr-webauthn/script-text.mock.data.ts @@ -3,7 +3,7 @@ * * script-text.mock.data.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/http-client/helpers.test.ts b/packages/javascript-sdk/src/http-client/helpers.test.ts index df0b22fb3..8a5331347 100644 --- a/packages/javascript-sdk/src/http-client/helpers.test.ts +++ b/packages/javascript-sdk/src/http-client/helpers.test.ts @@ -3,7 +3,7 @@ * * helpers.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/http-client/helpers.ts b/packages/javascript-sdk/src/http-client/helpers.ts index 73ccaf200..16ee0fa40 100644 --- a/packages/javascript-sdk/src/http-client/helpers.ts +++ b/packages/javascript-sdk/src/http-client/helpers.ts @@ -3,7 +3,7 @@ * * helpers.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/http-client/http-client.mock.data.ts b/packages/javascript-sdk/src/http-client/http-client.mock.data.ts index d739c8b6e..63471f45c 100644 --- a/packages/javascript-sdk/src/http-client/http-client.mock.data.ts +++ b/packages/javascript-sdk/src/http-client/http-client.mock.data.ts @@ -3,7 +3,7 @@ * * http-client.mock.data.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/http-client/index.ts b/packages/javascript-sdk/src/http-client/index.ts index ee67ea840..391c6b2c3 100644 --- a/packages/javascript-sdk/src/http-client/index.ts +++ b/packages/javascript-sdk/src/http-client/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/http-client/interfaces.ts b/packages/javascript-sdk/src/http-client/interfaces.ts index 68ea767a5..35d7b337d 100644 --- a/packages/javascript-sdk/src/http-client/interfaces.ts +++ b/packages/javascript-sdk/src/http-client/interfaces.ts @@ -3,7 +3,7 @@ * * interfaces.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/index.test.ts b/packages/javascript-sdk/src/index.test.ts index 39bc2e74f..119d2eb4d 100644 --- a/packages/javascript-sdk/src/index.test.ts +++ b/packages/javascript-sdk/src/index.test.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * index.test.ts + * + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import * as sdk from './'; import Auth from './auth'; import { CallbackType, ErrorCode } from './auth/enums'; diff --git a/packages/javascript-sdk/src/index.ts b/packages/javascript-sdk/src/index.ts index 86188b5f6..4added1e7 100644 --- a/packages/javascript-sdk/src/index.ts +++ b/packages/javascript-sdk/src/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020-2021 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/oauth2-client/enums.ts b/packages/javascript-sdk/src/oauth2-client/enums.ts index 25657ec32..d262765c2 100644 --- a/packages/javascript-sdk/src/oauth2-client/enums.ts +++ b/packages/javascript-sdk/src/oauth2-client/enums.ts @@ -3,7 +3,7 @@ * * enums.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/oauth2-client/index.ts b/packages/javascript-sdk/src/oauth2-client/index.ts index e6c705e40..fa3774291 100644 --- a/packages/javascript-sdk/src/oauth2-client/index.ts +++ b/packages/javascript-sdk/src/oauth2-client/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020-2021 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -309,12 +309,13 @@ abstract class OAuth2Client { }; init = init || ({} as RequestInit); + init.headers = (init.headers || new Headers()) as Headers; + init.headers.set('Accept', 'application/json'); if (includeToken) { const tokens = await TokenStorage.get(); const accessToken = tokens && tokens.accessToken; init.credentials = 'include'; - init.headers = (init.headers || new Headers()) as Headers; init.headers.set('Authorization', `Bearer ${accessToken}`); } const runMiddleware = middlewareWrapper( diff --git a/packages/javascript-sdk/src/oauth2-client/interfaces.ts b/packages/javascript-sdk/src/oauth2-client/interfaces.ts index 7f080a4fb..cdaaf9f7d 100644 --- a/packages/javascript-sdk/src/oauth2-client/interfaces.ts +++ b/packages/javascript-sdk/src/oauth2-client/interfaces.ts @@ -3,7 +3,7 @@ * * interfaces.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/oauth2-client/state-pkce.ts b/packages/javascript-sdk/src/oauth2-client/state-pkce.ts index bbb681047..fb800558a 100644 --- a/packages/javascript-sdk/src/oauth2-client/state-pkce.ts +++ b/packages/javascript-sdk/src/oauth2-client/state-pkce.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * state-pkce.ts + * + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import PKCE from '../util/pkce'; import { GetAuthorizationUrlOptions } from './interfaces'; diff --git a/packages/javascript-sdk/src/session-manager/index.ts b/packages/javascript-sdk/src/session-manager/index.ts index 8a65903a7..01d0ac29f 100644 --- a/packages/javascript-sdk/src/session-manager/index.ts +++ b/packages/javascript-sdk/src/session-manager/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/shared/constants.ts b/packages/javascript-sdk/src/shared/constants.ts index e0d617f1e..22682b952 100644 --- a/packages/javascript-sdk/src/shared/constants.ts +++ b/packages/javascript-sdk/src/shared/constants.ts @@ -3,7 +3,7 @@ * * constants.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/shared/interfaces.ts b/packages/javascript-sdk/src/shared/interfaces.ts index d8a5e8139..eb5c61c25 100644 --- a/packages/javascript-sdk/src/shared/interfaces.ts +++ b/packages/javascript-sdk/src/shared/interfaces.ts @@ -3,7 +3,7 @@ * * interfaces.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/shared/types.ts b/packages/javascript-sdk/src/shared/types.ts index 2728a5353..568305aa6 100644 --- a/packages/javascript-sdk/src/shared/types.ts +++ b/packages/javascript-sdk/src/shared/types.ts @@ -3,7 +3,7 @@ * * types.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/token-manager/helpers.test.ts b/packages/javascript-sdk/src/token-manager/helpers.test.ts index e09c21b92..89329bab5 100644 --- a/packages/javascript-sdk/src/token-manager/helpers.test.ts +++ b/packages/javascript-sdk/src/token-manager/helpers.test.ts @@ -3,7 +3,7 @@ * * helpers.test.ts * - * Copyright (c) 2022 ForgeRock. All rights reserved. + * Copyright (c) 2022 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/token-manager/helpers.ts b/packages/javascript-sdk/src/token-manager/helpers.ts index 1756d5ac9..9e7576790 100644 --- a/packages/javascript-sdk/src/token-manager/helpers.ts +++ b/packages/javascript-sdk/src/token-manager/helpers.ts @@ -3,7 +3,7 @@ * * helpers.ts * - * Copyright (c) 2022 ForgeRock. All rights reserved. + * Copyright (c) 2022 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/token-manager/index.test.ts b/packages/javascript-sdk/src/token-manager/index.test.ts index 0e8595339..dfda4f286 100644 --- a/packages/javascript-sdk/src/token-manager/index.test.ts +++ b/packages/javascript-sdk/src/token-manager/index.test.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * index.test.ts + * + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { vi, describe, it, expect } from 'vitest'; import TokenManager from '.'; import Config from '../config'; diff --git a/packages/javascript-sdk/src/token-manager/index.ts b/packages/javascript-sdk/src/token-manager/index.ts index 3d553b78f..a1fc73025 100644 --- a/packages/javascript-sdk/src/token-manager/index.ts +++ b/packages/javascript-sdk/src/token-manager/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020-2021 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ @@ -22,15 +22,28 @@ import { tokensWillExpireWithinThreshold } from './helpers'; interface GetTokensOptions extends ConfigOptions { forceRenew?: boolean; login?: 'embedded' | 'redirect' | undefined; + skipBackgroundRequest?: boolean; query?: StringDict; } +/** + * Token Manager class that provides high-level abstraction for Authorization Code flow, + * PKCE value generation, token exchange and token storage. + * + * Supports both embedded authentication as well as external authentication via redirects + */ abstract class TokenManager { /** - * Token Manager class that provides high-level abstraction for Authorization Code flow, - * PKCE value generation, token exchange and token storage. - * - * Supports both embedded authentication as well as external authentication via redirects + * @function getTokens - Retrieves OAuth2 tokens from the server or local storage. + * @param {Object} options - Options for retrieving tokens. + * @param {boolean} [options.forceRenew] - If true, forces a new token request even if tokens are already stored. + * @param {string} [options.login] - Specifies the type of login: 'embedded' or 'redirect'. + * @param {boolean} [options.skipBackgroundRequest] - If true, skips the background request to get tokens without redirect. + * @param {Object} [options.query] - Query key-value pairs to convert to URL parameters for the /authorize request. + * @param {string} [options.query.code] - Authorization code from the redirect URL. + * @param {string} [options.query.state] - State parameter from the redirect URL. + * @returns {Promise} - Returns a promise that resolves to the retrieved tokens or void. + * @throws {Error} - Throws an error if the client ID is not provided, if tokens cannot be exchanged, or if there is a state mismatch. * Example 1: @@ -63,6 +76,14 @@ abstract class TokenManager { }, }); ``` + + Example 4: + + ```js + const tokens = forgerock.TokenManager.getTokens({ + skipBackgroundRequest: true, // OPTIONAL; this will skip the iframe request to silently get tokens w/o redirect + }); + ``` */ public static async getTokens(options?: GetTokensOptions): Promise { const { clientId, oauthThreshold, prefix } = Config.get(options as ConfigOptions); @@ -132,68 +153,79 @@ abstract class TokenManager { responseType: ResponseType.Code, }); - /** - * Attempt to call the authorize URL to retrieve authorization code - */ - try { - // Check expected browser support - // To support legacy browsers, iframe works best with short timeout - const parsedUrl = new URL(await OAuth2Client.getAuthCodeByIframe(pkceValues)); - - // Throw if we have an error param or have no authorization code - if (parsedUrl.searchParams.get('error')) { - throw Error(`${parsedUrl.searchParams.get('error_description')}`); - } else if (!parsedUrl.searchParams.get('code')) { - throw Error(allowedErrors.AuthenticationConsentRequired); - } + if (!options) { + options = {}; + } - const parsedQuery = parseQuery(parsedUrl.toString()); + if (options.skipBackgroundRequest !== true) { + /** + * Attempt to call the authorize URL to retrieve authorization code + */ + try { + // Check expected browser support + // To support legacy browsers, iframe works best with short timeout + const parsedUrl = new URL(await OAuth2Client.getAuthCodeByIframe(pkceValues)); - if (!options) { - options = {}; - } - options.query = parsedQuery; - } catch (err) { - // If authorize request fails, handle according to `login` type - if (!(err instanceof Error) || options?.login !== 'redirect') { - // Throw for any error if login is NOT of type "redirect" - throw err; - } + // Throw if we have an error param or have no authorization code + if (parsedUrl.searchParams.get('error')) { + throw Error(`${parsedUrl.searchParams.get('error_description')}`); + } else if (!parsedUrl.searchParams.get('code')) { + throw Error(allowedErrors.AuthenticationConsentRequired); + } - // Check if error is not one of our allowed errors - if ( - allowedErrors.AuthenticationIsRequired !== err.message && - allowedErrors.AuthenticationConsentRequired !== err.message && - allowedErrors.AuthorizationTimeout !== err.message && - allowedErrors.FailedToFetch !== err.message && - allowedErrors.NetworkError !== err.message && - allowedErrors.InteractionNotAllowed !== err.message && - allowedErrors.RequestRequiresConsent !== err.message && - // Check for Ping Identity Login Required error - // Long message, so just check substring - !err.message.includes(allowedErrors.LoginRequired) && - // Safari has a very long error message, so we check for a substring - !err.message.includes(allowedErrors.CORSError) - ) { - // Throw if the error is NOT an explicitly allowed error along with redirect of true - // as that is a normal response and just requires a redirect - throw err; - } + const parsedQuery = parseQuery(parsedUrl.toString()); + + options.query = parsedQuery; + } catch (err) { + // If authorize request fails, handle according to `login` type + if (!(err instanceof Error) || options?.login !== 'redirect') { + // Throw for any error if login is NOT of type "redirect" + throw err; + } + + // Check if error is not one of our allowed errors + if ( + allowedErrors.AuthenticationIsRequired !== err.message && + allowedErrors.AuthenticationConsentRequired !== err.message && + allowedErrors.AuthorizationTimeout !== err.message && + allowedErrors.FailedToFetch !== err.message && + allowedErrors.NetworkError !== err.message && + allowedErrors.InteractionNotAllowed !== err.message && + allowedErrors.RequestRequiresConsent !== err.message && + // Check for Ping Identity Login Required error + // Long message, so just check substring + !err.message.includes(allowedErrors.LoginRequired) && + // Safari has a very long error message, so we check for a substring + !err.message.includes(allowedErrors.CORSError) + ) { + // Throw if the error is NOT an explicitly allowed error along with redirect of true + // as that is a normal response and just requires a redirect + throw err; + } + + const authorizeUrl = await OAuth2Client.createAuthorizeUrl(pkceValues); - const authorizeUrl = await OAuth2Client.createAuthorizeUrl(pkceValues); + // Before redirecting, store PKCE values + storePkceValues(); - // Before redirecting, store PKCE values - storePkceValues(); + return location.assign(authorizeUrl); + } - return location.assign(authorizeUrl); + /** + * Exchange authorization code for tokens + */ + return await this.tokenExchange(options, { + state: pkceValues.state, + verifier: pkceValues.verifier, + }); } - /** - * Exchange authorization code for tokens - */ - return await this.tokenExchange(options, { - state: pkceValues.state, - verifier: pkceValues.verifier, - }); + + const authorizeUrl = await OAuth2Client.createAuthorizeUrl(pkceValues); + + // Before redirecting, store PKCE values + storePkceValues(); + + return location.assign(authorizeUrl); } public static async deleteTokens(): Promise { diff --git a/packages/javascript-sdk/src/token-manager/token-manager.mock.data.ts b/packages/javascript-sdk/src/token-manager/token-manager.mock.data.ts index d0814e9f2..2889169a8 100644 --- a/packages/javascript-sdk/src/token-manager/token-manager.mock.data.ts +++ b/packages/javascript-sdk/src/token-manager/token-manager.mock.data.ts @@ -3,7 +3,7 @@ * * token-manager.mock.data.ts * - * Copyright (c) 2022 ForgeRock. All rights reserved. + * Copyright (c) 2022 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/token-storage/constants.ts b/packages/javascript-sdk/src/token-storage/constants.ts index 7a8000740..67c0d4de8 100644 --- a/packages/javascript-sdk/src/token-storage/constants.ts +++ b/packages/javascript-sdk/src/token-storage/constants.ts @@ -3,7 +3,7 @@ * * constants.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/token-storage/index.ts b/packages/javascript-sdk/src/token-storage/index.ts index e9f085724..2e9103cc1 100644 --- a/packages/javascript-sdk/src/token-storage/index.ts +++ b/packages/javascript-sdk/src/token-storage/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020-2021 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/token-storage/interfaces.ts b/packages/javascript-sdk/src/token-storage/interfaces.ts index 0a69cff8d..7be14eae7 100644 --- a/packages/javascript-sdk/src/token-storage/interfaces.ts +++ b/packages/javascript-sdk/src/token-storage/interfaces.ts @@ -3,7 +3,7 @@ * * interfaces.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/token-storage/local-storage.ts b/packages/javascript-sdk/src/token-storage/local-storage.ts index 4c8106ace..e7964c240 100644 --- a/packages/javascript-sdk/src/token-storage/local-storage.ts +++ b/packages/javascript-sdk/src/token-storage/local-storage.ts @@ -3,7 +3,7 @@ * * local-storage.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/token-storage/session-storage.ts b/packages/javascript-sdk/src/token-storage/session-storage.ts index f6417d002..f4088944a 100644 --- a/packages/javascript-sdk/src/token-storage/session-storage.ts +++ b/packages/javascript-sdk/src/token-storage/session-storage.ts @@ -3,7 +3,7 @@ * * session-storage.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/typings.d.ts b/packages/javascript-sdk/src/typings.d.ts index b0daa25c8..007bd70e3 100644 --- a/packages/javascript-sdk/src/typings.d.ts +++ b/packages/javascript-sdk/src/typings.d.ts @@ -3,7 +3,7 @@ * * typings.d.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/typings.test.d.ts b/packages/javascript-sdk/src/typings.test.d.ts index bd6f546bc..3861d29ac 100644 --- a/packages/javascript-sdk/src/typings.test.d.ts +++ b/packages/javascript-sdk/src/typings.test.d.ts @@ -3,7 +3,7 @@ * * typings.test.d.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/user-manager/index.ts b/packages/javascript-sdk/src/user-manager/index.ts index 79b8b98fb..706086cb7 100644 --- a/packages/javascript-sdk/src/user-manager/index.ts +++ b/packages/javascript-sdk/src/user-manager/index.ts @@ -3,7 +3,7 @@ * * index.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/deferred.ts b/packages/javascript-sdk/src/util/deferred.ts index d5f7201fe..fc002aa64 100644 --- a/packages/javascript-sdk/src/util/deferred.ts +++ b/packages/javascript-sdk/src/util/deferred.ts @@ -3,7 +3,7 @@ * * deferred.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/http.ts b/packages/javascript-sdk/src/util/http.ts index 8e437111e..79263562e 100644 --- a/packages/javascript-sdk/src/util/http.ts +++ b/packages/javascript-sdk/src/util/http.ts @@ -3,7 +3,7 @@ * * http.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/logger.test.ts b/packages/javascript-sdk/src/util/logger.test.ts index 4844984f3..b5326ec23 100644 --- a/packages/javascript-sdk/src/util/logger.test.ts +++ b/packages/javascript-sdk/src/util/logger.test.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * logger.test.ts + * + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { vi, describe, it, expect } from 'vitest'; import { FRLogger } from './logger'; import Config from '../config'; diff --git a/packages/javascript-sdk/src/util/logger.ts b/packages/javascript-sdk/src/util/logger.ts index a837d9402..6bf6f7863 100644 --- a/packages/javascript-sdk/src/util/logger.ts +++ b/packages/javascript-sdk/src/util/logger.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * logger.test.ts + * + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import Config from '../config/index'; import { LogLevel } from '../config/interfaces'; diff --git a/packages/javascript-sdk/src/util/middleware.mock.data.ts b/packages/javascript-sdk/src/util/middleware.mock.data.ts index 47aabd816..737f93154 100644 --- a/packages/javascript-sdk/src/util/middleware.mock.data.ts +++ b/packages/javascript-sdk/src/util/middleware.mock.data.ts @@ -3,7 +3,7 @@ * * middleware.mock.data.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/middleware.test.ts b/packages/javascript-sdk/src/util/middleware.test.ts index 41d6511e3..9ddab60cf 100644 --- a/packages/javascript-sdk/src/util/middleware.test.ts +++ b/packages/javascript-sdk/src/util/middleware.test.ts @@ -3,7 +3,7 @@ * * middleware.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/middleware.ts b/packages/javascript-sdk/src/util/middleware.ts index 9d5f1686c..fbbf9cd57 100644 --- a/packages/javascript-sdk/src/util/middleware.ts +++ b/packages/javascript-sdk/src/util/middleware.ts @@ -3,7 +3,7 @@ * * middleware.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/pkce.test.ts b/packages/javascript-sdk/src/util/pkce.test.ts index 4a1ffbc92..93e6cc8f4 100644 --- a/packages/javascript-sdk/src/util/pkce.test.ts +++ b/packages/javascript-sdk/src/util/pkce.test.ts @@ -3,7 +3,7 @@ * * pkce.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/pkce.ts b/packages/javascript-sdk/src/util/pkce.ts index c0b6f50de..30cc917e5 100644 --- a/packages/javascript-sdk/src/util/pkce.ts +++ b/packages/javascript-sdk/src/util/pkce.ts @@ -3,7 +3,7 @@ * * pkce.ts * - * Copyright (c) 2020-2021 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/realm.test.ts b/packages/javascript-sdk/src/util/realm.test.ts index 288925159..f8bd125d5 100644 --- a/packages/javascript-sdk/src/util/realm.test.ts +++ b/packages/javascript-sdk/src/util/realm.test.ts @@ -3,7 +3,7 @@ * * realm.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/realm.ts b/packages/javascript-sdk/src/util/realm.ts index fbc128cb2..71f9d31f9 100644 --- a/packages/javascript-sdk/src/util/realm.ts +++ b/packages/javascript-sdk/src/util/realm.ts @@ -3,7 +3,7 @@ * * realm.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/storage.ts b/packages/javascript-sdk/src/util/storage.ts index a91f868ff..9ef310828 100644 --- a/packages/javascript-sdk/src/util/storage.ts +++ b/packages/javascript-sdk/src/util/storage.ts @@ -3,7 +3,7 @@ * * storage.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/strings.ts b/packages/javascript-sdk/src/util/strings.ts index 045f8b0b6..92c0fed97 100644 --- a/packages/javascript-sdk/src/util/strings.ts +++ b/packages/javascript-sdk/src/util/strings.ts @@ -3,7 +3,7 @@ * * strings.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/timeout.test.ts b/packages/javascript-sdk/src/util/timeout.test.ts index 4b2b503ea..8e830f785 100644 --- a/packages/javascript-sdk/src/util/timeout.test.ts +++ b/packages/javascript-sdk/src/util/timeout.test.ts @@ -3,7 +3,7 @@ * * timeout.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/timeout.ts b/packages/javascript-sdk/src/util/timeout.ts index 60871cfc8..75f376291 100644 --- a/packages/javascript-sdk/src/util/timeout.ts +++ b/packages/javascript-sdk/src/util/timeout.ts @@ -3,7 +3,7 @@ * * timeout.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/url.test.ts b/packages/javascript-sdk/src/util/url.test.ts index 039ea2395..4a0870158 100644 --- a/packages/javascript-sdk/src/util/url.test.ts +++ b/packages/javascript-sdk/src/util/url.test.ts @@ -3,7 +3,7 @@ * * url.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/src/util/url.ts b/packages/javascript-sdk/src/util/url.ts index d70896ffb..42e3871e9 100644 --- a/packages/javascript-sdk/src/util/url.ts +++ b/packages/javascript-sdk/src/util/url.ts @@ -3,7 +3,7 @@ * * url.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/tests/integration/fr-auth.mock.data.ts b/packages/javascript-sdk/tests/integration/fr-auth.mock.data.ts index 8e2065aa3..82f9b0a8a 100644 --- a/packages/javascript-sdk/tests/integration/fr-auth.mock.data.ts +++ b/packages/javascript-sdk/tests/integration/fr-auth.mock.data.ts @@ -3,7 +3,7 @@ * * fr-auth.mock.data.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/tests/integration/fr-auth.test.ts b/packages/javascript-sdk/tests/integration/fr-auth.test.ts index 5ff76d65d..06e39584b 100644 --- a/packages/javascript-sdk/tests/integration/fr-auth.test.ts +++ b/packages/javascript-sdk/tests/integration/fr-auth.test.ts @@ -3,7 +3,7 @@ * * fr-auth.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/tests/integration/http-client.mock.data.ts b/packages/javascript-sdk/tests/integration/http-client.mock.data.ts index ad41883b7..58a033449 100644 --- a/packages/javascript-sdk/tests/integration/http-client.mock.data.ts +++ b/packages/javascript-sdk/tests/integration/http-client.mock.data.ts @@ -3,7 +3,7 @@ * * http-client.mock.data.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/tests/integration/http-client.test.ts b/packages/javascript-sdk/tests/integration/http-client.test.ts index f09c5957f..c97a436dd 100644 --- a/packages/javascript-sdk/tests/integration/http-client.test.ts +++ b/packages/javascript-sdk/tests/integration/http-client.test.ts @@ -3,7 +3,7 @@ * * http-client.test.ts * - * Copyright (c) 2020 ForgeRock. All rights reserved. + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ diff --git a/packages/javascript-sdk/tests/integration/oauth2-client.test.ts b/packages/javascript-sdk/tests/integration/oauth2-client.test.ts index 18c1c14be..576cdc2c3 100644 --- a/packages/javascript-sdk/tests/integration/oauth2-client.test.ts +++ b/packages/javascript-sdk/tests/integration/oauth2-client.test.ts @@ -1,3 +1,13 @@ +/* + * @forgerock/javascript-sdk + * + * oauth2-client.test.ts + * + * Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved. + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + import { vi, afterAll, describe, it, expect } from 'vitest'; import OAuth2Client from '../../src/oauth2-client/index'; import PKCE from '../../src/util/pkce'; diff --git a/packages/ping-protect/package.json b/packages/ping-protect/package.json index d51172cd1..888a82c0b 100644 --- a/packages/ping-protect/package.json +++ b/packages/ping-protect/package.json @@ -3,7 +3,9 @@ "version": "4.6.0", "private": false, "type": "module", - "files": ["dist"], + "files": [ + "dist" + ], "module": "./dist/index.js", "main": "./dist/index.js", "repository": { @@ -11,7 +13,9 @@ "url": "git+https://github.com:ForgeRock/forgerock-javascript-sdk.git", "directory": "packages/ping-protect" }, - "sideEffects": ["./dist/lib/ping-signals-sdk.js"], + "sideEffects": [ + "./dist/lib/ping-signals-sdk.js" + ], "exports": { ".": { "types": "./dist/index.ts.d.ts", diff --git a/packages/ping-protect/src/index.test.ts b/packages/ping-protect/src/index.test.ts index 5a79bdfc9..81bec018d 100644 --- a/packages/ping-protect/src/index.test.ts +++ b/packages/ping-protect/src/index.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import * as module from './index.js'; describe('PIProtect', () => { diff --git a/packages/ping-protect/src/index.ts b/packages/ping-protect/src/index.ts index e3ec0887a..12a67d428 100644 --- a/packages/ping-protect/src/index.ts +++ b/packages/ping-protect/src/index.ts @@ -1 +1,10 @@ +/** + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + export * from './lib/ping-protect.js'; diff --git a/packages/ping-protect/src/lib/ping-protect.mock.data.ts b/packages/ping-protect/src/lib/ping-protect.mock.data.ts index d02a18aae..40a751b82 100644 --- a/packages/ping-protect/src/lib/ping-protect.mock.data.ts +++ b/packages/ping-protect/src/lib/ping-protect.mock.data.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { CallbackType, FRStep } from '@forgerock/javascript-sdk'; export const standardPingProtectInitializeStep = new FRStep({ diff --git a/packages/ping-protect/src/lib/ping-protect.test.ts b/packages/ping-protect/src/lib/ping-protect.test.ts index a34fac396..bbdc74ad0 100644 --- a/packages/ping-protect/src/lib/ping-protect.test.ts +++ b/packages/ping-protect/src/lib/ping-protect.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { vi, expect, describe, it } from 'vitest'; import { PIProtect } from './ping-protect.js'; import { diff --git a/packages/ping-protect/src/lib/ping-protect.ts b/packages/ping-protect/src/lib/ping-protect.ts index 2a6bf90df..839a8405a 100644 --- a/packages/ping-protect/src/lib/ping-protect.ts +++ b/packages/ping-protect/src/lib/ping-protect.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { CallbackType, FRStep, diff --git a/packages/ping-protect/src/lib/ping-protect.types.ts b/packages/ping-protect/src/lib/ping-protect.types.ts index 1df9a6963..2263d52cd 100644 --- a/packages/ping-protect/src/lib/ping-protect.types.ts +++ b/packages/ping-protect/src/lib/ping-protect.types.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + export interface ProtectInitializeConfig { _type: 'PingOneProtect'; _action: 'protect_initialize'; diff --git a/packages/ping-protect/src/lib/ping-signals-sdk.js b/packages/ping-protect/src/lib/ping-signals-sdk.js index d05857e05..4f80582f3 100644 --- a/packages/ping-protect/src/lib/ping-signals-sdk.js +++ b/packages/ping-protect/src/lib/ping-signals-sdk.js @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2024 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + if (typeof window !== 'undefined') { var _POSignalsEntities; !(function (t, e) { diff --git a/packages/token-vault/LICENSE b/packages/token-vault/LICENSE index a1e82df86..339926bf2 100644 --- a/packages/token-vault/LICENSE +++ b/packages/token-vault/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 ForgeRock +Copyright (c) 2023-2025 Ping Identity Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/token-vault/package.json b/packages/token-vault/package.json index 4314d9d77..ab926cb94 100644 --- a/packages/token-vault/package.json +++ b/packages/token-vault/package.json @@ -3,7 +3,9 @@ "version": "4.2.0", "private": false, "type": "module", - "files": ["dist/*"], + "files": [ + "dist/*" + ], "repository": { "type": "git", "url": "git+https://github.com:ForgeRock/forgerock-javascript-sdk.git", diff --git a/packages/token-vault/src/index.ts b/packages/token-vault/src/index.ts index d04b151d3..3a73dff7d 100644 --- a/packages/token-vault/src/index.ts +++ b/packages/token-vault/src/index.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { interceptor as interceptorModule } from './lib/worker/index.js'; import { client as clientModule } from './lib/client.js'; import { proxy as proxyModule } from './lib/proxy.js'; diff --git a/packages/token-vault/src/lib/client.ts b/packages/token-vault/src/lib/client.ts index 9c5bf8708..acc288cda 100644 --- a/packages/token-vault/src/lib/client.ts +++ b/packages/token-vault/src/lib/client.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import type { Tokens } from '@forgerock/javascript-sdk'; import type { BaseConfig } from './types/index.js'; import { ClientInit } from './types/client.types.js'; diff --git a/packages/token-vault/src/lib/network/index.ts b/packages/token-vault/src/lib/network/index.ts index 76e93c039..001f49c22 100644 --- a/packages/token-vault/src/lib/network/index.ts +++ b/packages/token-vault/src/lib/network/index.ts @@ -1 +1,10 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + export * from './network.utilities.js'; diff --git a/packages/token-vault/src/lib/network/network.utilities.test.ts b/packages/token-vault/src/lib/network/network.utilities.test.ts index aec219f28..cee663bc7 100644 --- a/packages/token-vault/src/lib/network/network.utilities.test.ts +++ b/packages/token-vault/src/lib/network/network.utilities.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { createErrorResponse, evaluateUrlForInterception, diff --git a/packages/token-vault/src/lib/network/network.utilities.ts b/packages/token-vault/src/lib/network/network.utilities.ts index e1a4eca96..f7be32982 100644 --- a/packages/token-vault/src/lib/network/network.utilities.ts +++ b/packages/token-vault/src/lib/network/network.utilities.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + /// reference libs="WebWorker" import type { ConfigOptions } from '@forgerock/javascript-sdk'; import type { diff --git a/packages/token-vault/src/lib/proxy.ts b/packages/token-vault/src/lib/proxy.ts index ca7d45904..b78560f48 100644 --- a/packages/token-vault/src/lib/proxy.ts +++ b/packages/token-vault/src/lib/proxy.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { cloneResponse, createErrorResponse, diff --git a/packages/token-vault/src/lib/token.utils.test.ts b/packages/token-vault/src/lib/token.utils.test.ts index 93562bb7a..bb4227087 100644 --- a/packages/token-vault/src/lib/token.utils.test.ts +++ b/packages/token-vault/src/lib/token.utils.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { tokenExpiryWithinThreshold } from './token.utils.js'; import { vi } from 'vitest'; diff --git a/packages/token-vault/src/lib/token.utils.ts b/packages/token-vault/src/lib/token.utils.ts index dbd1f8e79..5c59eb9bc 100644 --- a/packages/token-vault/src/lib/token.utils.ts +++ b/packages/token-vault/src/lib/token.utils.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { ClientTokens, RefreshOAuth2TokensOptions, ServerTokens } from './types/index.js'; import { stringifyQueryParams } from './network/index.js'; diff --git a/packages/token-vault/src/lib/types/client.types.ts b/packages/token-vault/src/lib/types/client.types.ts index 1b0301017..1d862e75d 100644 --- a/packages/token-vault/src/lib/types/client.types.ts +++ b/packages/token-vault/src/lib/types/client.types.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import type { Tokens } from '@forgerock/javascript-sdk'; import type { BaseConfig } from './config.types.js'; diff --git a/packages/token-vault/src/lib/types/config.types.ts b/packages/token-vault/src/lib/types/config.types.ts index f05835e4c..bfc6a70ac 100644 --- a/packages/token-vault/src/lib/types/config.types.ts +++ b/packages/token-vault/src/lib/types/config.types.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + /** **************************************************************** * This contains a few types pulled from the JavaScript SDK * TODO: Refactor the SDK to use these shared types instead of the internal ones diff --git a/packages/token-vault/src/lib/types/index.ts b/packages/token-vault/src/lib/types/index.ts index 913fe6398..e66df3f70 100644 --- a/packages/token-vault/src/lib/types/index.ts +++ b/packages/token-vault/src/lib/types/index.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + export * from './client.types.js'; export * from './config.types.js'; export * from './network.types.js'; diff --git a/packages/token-vault/src/lib/types/network.types.ts b/packages/token-vault/src/lib/types/network.types.ts index 569164298..f5a4643b7 100644 --- a/packages/token-vault/src/lib/types/network.types.ts +++ b/packages/token-vault/src/lib/types/network.types.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + export type ResponseClone = { body: unknown; headers: Record; diff --git a/packages/token-vault/src/lib/types/tokens.types.ts b/packages/token-vault/src/lib/types/tokens.types.ts index a2de2987d..0bd72a952 100644 --- a/packages/token-vault/src/lib/types/tokens.types.ts +++ b/packages/token-vault/src/lib/types/tokens.types.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import type { GetOAuth2TokensOptions } from '@forgerock/javascript-sdk'; export type RefreshOAuth2TokensOptionsInit = Omit; diff --git a/packages/token-vault/src/lib/types/worker.types.ts b/packages/token-vault/src/lib/types/worker.types.ts index b48b08164..e1afdcec8 100644 --- a/packages/token-vault/src/lib/types/worker.types.ts +++ b/packages/token-vault/src/lib/types/worker.types.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import type { BaseConfig, ForgeRockConfig } from './config.types.js'; export interface InterceptorConfig { diff --git a/packages/token-vault/src/lib/worker/index.ts b/packages/token-vault/src/lib/worker/index.ts index 1b48bf146..4f15323b1 100644 --- a/packages/token-vault/src/lib/worker/index.ts +++ b/packages/token-vault/src/lib/worker/index.ts @@ -1,2 +1,11 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + export * from './interceptor.js'; export * from './worker.utilities.js'; diff --git a/packages/token-vault/src/lib/worker/interceptor.test.ts b/packages/token-vault/src/lib/worker/interceptor.test.ts index 43bc01b58..5addd0207 100644 --- a/packages/token-vault/src/lib/worker/interceptor.test.ts +++ b/packages/token-vault/src/lib/worker/interceptor.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { interceptor } from './interceptor.js'; describe('interceptor', () => { diff --git a/packages/token-vault/src/lib/worker/interceptor.ts b/packages/token-vault/src/lib/worker/interceptor.ts index 33b1a7875..0bbb8d259 100644 --- a/packages/token-vault/src/lib/worker/interceptor.ts +++ b/packages/token-vault/src/lib/worker/interceptor.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + /// import { evaluateUrlForInterception } from '../network/index.js'; diff --git a/packages/token-vault/src/lib/worker/worker.utilities.test.ts b/packages/token-vault/src/lib/worker/worker.utilities.test.ts index 48879228a..6e6382c12 100644 --- a/packages/token-vault/src/lib/worker/worker.utilities.test.ts +++ b/packages/token-vault/src/lib/worker/worker.utilities.test.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { generateUrlsToIntercept } from './worker.utilities.js'; // Test that the generateUrlsToIntercept function returns the expected array of URLs diff --git a/packages/token-vault/src/lib/worker/worker.utilities.ts b/packages/token-vault/src/lib/worker/worker.utilities.ts index 8621ac1a7..f3c5b57a7 100644 --- a/packages/token-vault/src/lib/worker/worker.utilities.ts +++ b/packages/token-vault/src/lib/worker/worker.utilities.ts @@ -1,3 +1,12 @@ +/** + * + * Copyright (c) 2023 - 2025 Ping Identity Corporation. All right reserved. + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + * + **/ + import { checkForMissingSlash, getEndpointPath,