Skip to content

Commit 27e36e1

Browse files
authored
Revert "Release PR"
1 parent 957bfb6 commit 27e36e1

307 files changed

Lines changed: 505 additions & 1969 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
*/DS_Store
44
**/*.DS_Store
55
.pnpm-store/*
6-
76
# Generated code
87
tmp/
98
e2e/**/dist
@@ -31,10 +30,9 @@ packages/javascript-sdk/lib/
3130
.swc
3231
.vite
3332
.env.serve.development
34-
package-lock.json
3533

3634
# Certificates
37-
*.pem
35+
# *.pem
3836

3937
# IDEs
4038
.vscode
@@ -85,4 +83,4 @@ outputs/*
8583

8684
e2e/mock-api-v2/html/*
8785

88-
vitest.config.*.timestamp*
86+
vitest.config.*.timestamp*

e2e/autoscript-apps/index.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,14 @@
2626
<a href="./src/authn-basic/index.html">AuthN: Basic</a><br />
2727
<a href="./src/authn-basic-self-service/">AuthN: Self Service</a><br />
2828
<a href="./src/authn-central-login/index.html">AuthN: Central Login</a><br />
29-
<a href="./src/authn-central-login-no-iframe/index.html">AuthN: Central Login, no iframe</a
30-
><br />
3129
<a href="./src/authn-central-logout/index.html">AuthN: Central Logout Ping</a><br />
32-
<a href="./src/authn-central-logout-wellknown/index.html"
33-
>AuthN: Central Logout with Wellknown</a
34-
><br />
3530
<a href="./src/authn-device-profile/index.html">AuthN: Device Profile</a><br />
3631
<a href="./src/authn-protect/index.html">AuthN: Ping Protect</a><br />
3732
<a href="./src/authn-email-suspend/index.html">AuthN: Email Suspend</a><br />
3833
<a href="./src/authn-recaptcha-enterprise/index.html">AuthN: Recaptcha Enterprise</a><br />
3934
<a href="./src/authn-no-session/index.html">AuthN: No Session</a><br />
4035
<a href="./src/authn-oauth/index.html">AuthN: OAuth</a><br />
36+
<a href="./src/authn-wellknown/index.html">AuthN: WellKnown</a><br />
4137
<a href="./src/authn-platform/index.html">AuthN: Platform Login</a><br />
4238
<a href="./src/authn-second-factor/index.html">AuthN: Second Factor</a><br />
4339
<a href="./src/authn-saml/index.html">AuthN: SAML</a><br />

e2e/autoscript-apps/src/authn-basic-self-service/autoscript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* autoscript.ts
55
*
6-
* Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved.
6+
* Copyright (c) 2020 ForgeRock. All rights reserved.
77
* This software may be modified and distributed under the terms
88
* of the MIT license. See the LICENSE file for details.
99
*/

e2e/autoscript-apps/src/authn-basic/autoscript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* autoscript.ts
55
*
6-
* Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved.
6+
* Copyright (c) 2020 ForgeRock. All rights reserved.
77
* This software may be modified and distributed under the terms
88
* of the MIT license. See the LICENSE file for details.
99
*/

e2e/autoscript-apps/src/authn-central-login-no-iframe/autoscript.ts

Lines changed: 0 additions & 145 deletions
This file was deleted.

e2e/autoscript-apps/src/authn-central-login-wellknown/autoscript.ts

Lines changed: 38 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* autoscript.ts
55
*
6-
* Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved.
6+
* Copyright (c) 2020 ForgeRock. All rights reserved.
77
* This software may be modified and distributed under the terms
88
* of the MIT license. See the LICENSE file for details.
99
*/
@@ -16,50 +16,49 @@ async function autoscript() {
1616
const delay = 0;
1717

1818
const url = new URL(window.location.href);
19-
const preAuthenticated = url.searchParams.get('preAuthenticated') || 'false';
2019
const code = url.searchParams.get('code') || '';
21-
const clientId = url.searchParams.get('clientId');
22-
const client_id = url.searchParams.get('client_id');
23-
const error = url.searchParams.get('error_description') || false;
24-
const realmPath = url.searchParams.get('realmPath') || 'root';
25-
const scope = url.searchParams.get('scope') || 'openid profile me.read';
20+
const error = url.searchParams.get('error') || '';
2621
const state = url.searchParams.get('state') || '';
27-
const acr_values = url.searchParams.get('acr') || 'SpecificTree';
2822
// in central login we use an auth query param for the return of our mock 401 request
2923
// this is to prevent the evaluation of the page before we have technically authenticated
3024
const auth = url.searchParams.get('auth') || false;
31-
let wellknown =
32-
url.searchParams.get('wellknown') || 'http://localhost:9443/am/.well-known/oidc-configuration';
25+
const acr_values = url.searchParams.get('acr') || 'SpecificTree';
3326

34-
let tokenStore = url.searchParams.get('tokenStore') || 'localStorage';
27+
let clientId = url.searchParams.get('clientId') || 'CentralLoginOAuthClient';
28+
let realmPath = url.searchParams.get('realmPath') || 'root';
29+
// The `revoke` scope is required for PingOne support
30+
let scope = url.searchParams.get('scope') || 'openid profile me.read revoke';
31+
let wellKnownUrl =
32+
url.searchParams.get('wellKnownUrl') ||
33+
'http://localhost:9443/am/.well-known/oidc-configuration';
3534

36-
// Support full redirects by setting storage, rather than rely purely on URL
37-
if (!localStorage.getItem('tokenStore')) {
38-
localStorage.setItem('tokenStore', tokenStore);
35+
console.log('Configure the SDK');
36+
37+
if (wellKnownUrl) {
38+
localStorage.setItem('wellknown', wellKnownUrl);
39+
localStorage.setItem('clientId', clientId);
40+
localStorage.setItem('realmPath', realmPath);
41+
localStorage.setItem('scope', scope);
3942
} else {
40-
tokenStore = localStorage.getItem('tokenStore');
43+
wellKnownUrl = localStorage.getItem('wellknown');
44+
clientId = localStorage.getItem('clientId');
45+
realmPath = localStorage.getItem('realmPath');
46+
scope = localStorage.getItem('scope');
4147
}
42-
43-
console.log('Configure the SDK');
44-
forgerock.Config.setAsync({
45-
clientId: clientId || client_id || 'CentralLoginOAuthClient',
48+
await forgerock.Config.setAsync({
49+
clientId,
4650
realmPath,
47-
redirectUri: `${url.origin}/src/${
48-
preAuthenticated === 'false' ? 'authn-central-login' : '_callback'
49-
}/`,
51+
redirectUri: `${url.origin}/src/authn-central-login-wellknown/`,
5052
scope,
5153
serverConfig: {
52-
wellknown,
54+
wellknown: wellKnownUrl,
5355
},
54-
tokenStore,
5556
});
5657

57-
if (!code && !state) {
58-
try {
59-
forgerock.SessionManager.logout();
60-
} catch (err) {
61-
// Do nothing
62-
}
58+
try {
59+
forgerock.SessionManager.logout();
60+
} catch (err) {
61+
// Do nothing
6362
}
6463

6564
console.log('Initiate first step with `undefined`');
@@ -68,29 +67,15 @@ async function autoscript() {
6867
setTimeout(() => {
6968
from([1])
7069
.pipe(
71-
map(() => {
72-
if (preAuthenticated === 'true') {
73-
console.log('Set mock cookie to represent existing session');
74-
document.cookie = 'iPlanetDirectoryPro=abcd1234; domain=localhost; path=/';
75-
if (code && state) {
76-
window.sessionStorage.setItem(
77-
`FR-SDK-authflow-${clientId}`,
78-
JSON.stringify({ responseType: 'code', state, verifier: '1234' }),
79-
);
80-
}
81-
}
82-
return;
83-
}),
84-
rxDelay(delay),
85-
mergeMap((step) => {
70+
mergeMap(() => {
8671
let tokens;
87-
if (error) {
88-
// Do nothing
72+
// detect when in iframe as to not call `/authorize` needlessly
73+
if (window.self !== window.top) {
8974
return;
9075
} else if (code && state) {
9176
tokens = forgerock.TokenManager.getTokens({
9277
login: 'redirect',
93-
query: { code, state, acr_values },
78+
query: { code, state },
9479
});
9580
} else {
9681
tokens = forgerock.TokenManager.getTokens({
@@ -113,6 +98,7 @@ async function autoscript() {
11398
console.log('Remove cookie');
11499
document.cookie = '';
115100
console.log('Initiate logout');
101+
// You have to allow specific origins to CORS for OAuth client
116102
return forgerock.FRUser.logout();
117103
}),
118104
)
@@ -130,12 +116,14 @@ async function autoscript() {
130116
}
131117
console.log(`Error: ${err.message}`);
132118
document.body.innerHTML = `<p class="Test_Complete">${err.message}</p>`;
133-
localStorage.clear();
134119
},
135120
complete: () => {
136121
console.log('Test script complete');
137122
document.body.innerHTML = `<p class="Test_Complete">Test script complete</p>`;
138-
localStorage.clear();
123+
localStorage.removeItem('wellknown');
124+
localStorage.removeItem('clientId');
125+
localStorage.removeItem('realmPath');
126+
localStorage.removeItem('scope');
139127
},
140128
});
141129
}, 250);

e2e/autoscript-apps/src/authn-central-login/autoscript.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* autoscript.ts
55
*
6-
* Copyright (c) 2020 - 2025 Ping Identity Corporation. All rights reserved.
6+
* Copyright (c) 2020 ForgeRock. All rights reserved.
77
* This software may be modified and distributed under the terms
88
* of the MIT license. See the LICENSE file for details.
99
*/

0 commit comments

Comments
 (0)