Skip to content

Commit c806452

Browse files
authored
Merge pull request #368 from ForgeRock/SDKS-4053-qa-oidc-client
SDKS-4053: Add OIDC client tests
2 parents 0ab715e + 5fe1f95 commit c806452

47 files changed

Lines changed: 1671 additions & 356 deletions

Some content is hidden

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

.changeset/moody-chefs-hammer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@forgerock/oidc-client': minor
3+
---
4+
5+
Added tests for oidc client

e2e/oidc-app/index.html

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

e2e/oidc-app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
},
1111
"dependencies": {
1212
"@forgerock/javascript-sdk": "^4.8.2",
13-
"@forgerock/oidc-client": "workspace:*"
13+
"@forgerock/oidc-client": "workspace:*",
14+
"@forgerock/sdk-types": "workspace:*"
1415
},
1516
"nx": {
1617
"tags": ["scope:app"]

e2e/oidc-app/src/assets/.gitkeep

Whitespace-only changes.

e2e/oidc-app/src/index.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>OIDC Client E2E Test Index | Ping Identity JavaScript SDK</title>
8+
</head>
9+
<body>
10+
<div id="app">
11+
<h2>OIDC Client E2E Test Index | Ping Identity JavaScript SDK</h2>
12+
<div id="nav">
13+
<a href="/ping-am/">Ping AM</a>
14+
<a href="/ping-one/">Ping One</a>
15+
</div>
16+
</div>
17+
<script type="module" src="index.ts"></script>
18+
</body>
19+
</html>

e2e/oidc-app/src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/*
2+
*
3+
* Copyright © 2025 Ping Identity Corporation. All right reserved.
4+
*
5+
* This software may be modified and distributed under the terms
6+
* of the MIT license. See the LICENSE file for details.
7+
*
8+
*/
9+
10+
import './styles.css';

e2e/oidc-app/src/main.ts

Lines changed: 0 additions & 109 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>E2E Test | Ping Identity JavaScript SDK</title>
5+
6+
<style>
7+
#logout,
8+
#userinfo {
9+
display: none;
10+
}
11+
</style>
12+
</head>
13+
<body>
14+
<div id="app">
15+
<a href="/">Home</a>
16+
<h1>OIDC App | PingAM Login</h1>
17+
<button id="login-background">Login (Background)</button>
18+
<button id="login-redirect">Login (Redirect)</button>
19+
<button id="get-tokens">Get Tokens</button>
20+
<button id="renew-tokens">Renew Tokens</button>
21+
<button id="logout">Logout</button>
22+
<button id="userinfo">User Info</button>
23+
<a href="/ping-am/">Start Over</a>
24+
</div>
25+
<script type="module" src="./main.ts"></script>
26+
</body>
27+
</html>

e2e/oidc-app/src/ping-am/main.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
*
3+
* Copyright © 2025 Ping Identity Corporation. All right reserved.
4+
*
5+
* This software may be modified and distributed under the terms
6+
* of the MIT license. See the LICENSE file for details.
7+
*
8+
*/
9+
import { oidcApp } from '../utils/oidc-app.js';
10+
11+
const urlParams = new URLSearchParams(window.location.search);
12+
const clientId = urlParams.get('clientid');
13+
const wellknown = urlParams.get('wellknown');
14+
15+
const config = {
16+
clientId: clientId || 'WebOAuthClient',
17+
redirectUri: 'http://localhost:8443/ping-am/',
18+
scope: 'openid profile email',
19+
serverConfig: {
20+
wellknown:
21+
wellknown ||
22+
'https://openam-sdks.forgeblocks.com/am/oauth2/alpha/.well-known/openid-configuration',
23+
},
24+
};
25+
26+
oidcApp({ config, urlParams });
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>E2E Test | Ping Identity JavaScript SDK</title>
5+
6+
<style>
7+
#logout,
8+
#userinfo {
9+
display: none;
10+
}
11+
</style>
12+
</head>
13+
<body>
14+
<div id="app">
15+
<a href="/">Home</a>
16+
<h1>OIDC App | P1 Login</h1>
17+
<button id="login-background">Login (Background)</button>
18+
<button id="login-redirect">Login (Redirect)</button>
19+
<button id="get-tokens">Get Tokens</button>
20+
<button id="renew-tokens">Renew Tokens</button>
21+
<button id="logout">Logout</button>
22+
<button id="userinfo">User Info</button>
23+
<a href="/ping-one/">Start Over</a>
24+
</div>
25+
<script type="module" src="./main.ts"></script>
26+
</body>
27+
</html>

0 commit comments

Comments
 (0)