Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/moody-chefs-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@forgerock/oidc-client': minor
---

Added tests for oidc client
28 changes: 0 additions & 28 deletions e2e/oidc-app/index.html

This file was deleted.

3 changes: 2 additions & 1 deletion e2e/oidc-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"dependencies": {
"@forgerock/javascript-sdk": "^4.8.2",
"@forgerock/oidc-client": "workspace:*"
"@forgerock/oidc-client": "workspace:*",
"@forgerock/sdk-types": "workspace:*"
},
"nx": {
"tags": ["scope:app"]
Expand Down
Empty file removed e2e/oidc-app/src/assets/.gitkeep
Empty file.
19 changes: 19 additions & 0 deletions e2e/oidc-app/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OIDC Client E2E Test Index | Ping Identity JavaScript SDK</title>
</head>
<body>
<div id="app">
<h2>OIDC Client E2E Test Index | Ping Identity JavaScript SDK</h2>
<div id="nav">
<a href="/ping-am/">Ping AM</a>
<a href="/ping-one/">Ping One</a>
</div>
</div>
<script type="module" src="index.ts"></script>
</body>
</html>
10 changes: 10 additions & 0 deletions e2e/oidc-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
*
* Copyright © 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 './styles.css';
109 changes: 0 additions & 109 deletions e2e/oidc-app/src/main.ts

This file was deleted.

27 changes: 27 additions & 0 deletions e2e/oidc-app/src/ping-am/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<html>
<head>
<title>E2E Test | Ping Identity JavaScript SDK</title>

<style>
#logout,
#userinfo {
display: none;
}
</style>
</head>
<body>
<div id="app">
<a href="/">Home</a>
<h1>OIDC App | PingAM Login</h1>
<button id="login-background">Login (Background)</button>
<button id="login-redirect">Login (Redirect)</button>
<button id="get-tokens">Get Tokens</button>
<button id="renew-tokens">Renew Tokens</button>
<button id="logout">Logout</button>
<button id="userinfo">User Info</button>
<a href="/ping-am/">Start Over</a>
</div>
<script type="module" src="./main.ts"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions e2e/oidc-app/src/ping-am/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
*
* Copyright © 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 { oidcApp } from '../utils/oidc-app.js';

const urlParams = new URLSearchParams(window.location.search);
const clientId = urlParams.get('clientid');
const wellknown = urlParams.get('wellknown');

const config = {
clientId: clientId || 'WebOAuthClient',
redirectUri: 'http://localhost:8443/ping-am/',
scope: 'openid profile email',
serverConfig: {
wellknown:
wellknown ||
'https://openam-sdks.forgeblocks.com/am/oauth2/alpha/.well-known/openid-configuration',
},
};

oidcApp({ config, urlParams });
27 changes: 27 additions & 0 deletions e2e/oidc-app/src/ping-one/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!doctype html>
<html>
<head>
<title>E2E Test | Ping Identity JavaScript SDK</title>

<style>
#logout,
#userinfo {
display: none;
}
</style>
</head>
<body>
<div id="app">
<a href="/">Home</a>
<h1>OIDC App | P1 Login</h1>
<button id="login-background">Login (Background)</button>
<button id="login-redirect">Login (Redirect)</button>
<button id="get-tokens">Get Tokens</button>
<button id="renew-tokens">Renew Tokens</button>
<button id="logout">Logout</button>
<button id="userinfo">User Info</button>
<a href="/ping-one/">Start Over</a>
</div>
<script type="module" src="./main.ts"></script>
</body>
</html>
26 changes: 26 additions & 0 deletions e2e/oidc-app/src/ping-one/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
*
* Copyright © 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 { oidcApp } from '../utils/oidc-app.js';

const urlParams = new URLSearchParams(window.location.search);
const clientId = urlParams.get('clientid');
const wellknown = urlParams.get('wellknown');

const config = {
clientId: clientId || '654b14e2-7cc5-4977-8104-c4113e43c537',
redirectUri: 'http://localhost:8443/ping-one/',
scope: 'openid revoke profile email',
serverConfig: {
wellknown:
wellknown ||
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/.well-known/openid-configuration',
},
};

oidcApp({ config, urlParams });
100 changes: 100 additions & 0 deletions e2e/oidc-app/src/styles.css
Original file line number Diff line number Diff line change
@@ -1 +1,101 @@
/* You can add global styles to this file, and also import other style files */
:root {
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
font-weight: 400;

color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
}

#nav > a {
display: block;
}

body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

#app {
max-width: 1280px;
margin: 0 auto;
padding: 2rem;
text-align: center;
}

.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vanilla:hover {
filter: drop-shadow(0 0 2em #3178c6aa);
}

.card {
padding: 2em;
}

.read-the-docs {
color: #888;
}

button {
border-radius: 8px;
border: 1px solid transparent;
padding: 0.6em 1.2em;
font-size: 1em;
font-weight: 500;
font-family: inherit;
background-color: #1a1a1a;
cursor: pointer;
transition: border-color 0.25s;
}
button:hover {
border-color: #646cff;
}
button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
Loading
Loading