Skip to content

Commit 1243ac3

Browse files
committed
test(oidc-client): add oidc client tests
1 parent b917bb2 commit 1243ac3

File tree

18 files changed

+603
-178
lines changed

18 files changed

+603
-178
lines changed

e2e/oidc-app/index.html

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

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 & 97 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 class="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="logout">Logout</button>
20+
<button id="userinfo">User Info</button>
21+
<a href="/ping-am/">Start Over</a>
22+
</div>
23+
<script type="module" src="./main.ts"></script>
24+
</body>
25+
</html>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { oidcApp } from '../utils/oidc-app.js';
2+
3+
const config = {
4+
clientId: 'WebOAuthClient',
5+
redirectUri: 'http://localhost:8443/ping-am/',
6+
scope: 'openid profile email',
7+
serverConfig: {
8+
wellknown:
9+
'https://openam-sdks.forgeblocks.com/am/oauth2/alpha/.well-known/openid-configuration',
10+
},
11+
};
12+
13+
oidcApp({ config });
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<a href="/">Home</a>
15+
<h1>OIDC App | P1 Login</h1>
16+
<button id="login-background">Login (Background)</button>
17+
<button id="login-redirect">Login (Redirect)</button>
18+
<button id="logout">Logout</button>
19+
<button id="userinfo">User Info</button>
20+
<a href="/ping-one/">Start Over</a>
21+
<script type="module" src="./main.ts"></script>
22+
</body>
23+
</html>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { oidcApp } from '../utils/oidc-app.js';
2+
3+
const config = {
4+
clientId: '654b14e2-7cc5-4977-8104-c4113e43c537',
5+
redirectUri: 'http://localhost:8443/ping-one/',
6+
scope: 'openid revoke profile email',
7+
serverConfig: {
8+
wellknown:
9+
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/.well-known/openid-configuration',
10+
},
11+
};
12+
13+
oidcApp({ config });

e2e/oidc-app/src/styles.css

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,101 @@
11
/* You can add global styles to this file, and also import other style files */
2+
:root {
3+
font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
4+
line-height: 1.5;
5+
font-weight: 400;
6+
7+
color-scheme: light dark;
8+
color: rgba(255, 255, 255, 0.87);
9+
background-color: #242424;
10+
11+
font-synthesis: none;
12+
text-rendering: optimizeLegibility;
13+
-webkit-font-smoothing: antialiased;
14+
-moz-osx-font-smoothing: grayscale;
15+
}
16+
17+
a {
18+
font-weight: 500;
19+
color: #646cff;
20+
text-decoration: inherit;
21+
}
22+
a:hover {
23+
color: #535bf2;
24+
}
25+
26+
#nav > a {
27+
display: block;
28+
}
29+
30+
body {
31+
margin: 0;
32+
display: flex;
33+
place-items: center;
34+
min-width: 320px;
35+
min-height: 100vh;
36+
}
37+
38+
h1 {
39+
font-size: 3.2em;
40+
line-height: 1.1;
41+
}
42+
43+
#app {
44+
max-width: 1280px;
45+
margin: 0 auto;
46+
padding: 2rem;
47+
text-align: center;
48+
}
49+
50+
.logo {
51+
height: 6em;
52+
padding: 1.5em;
53+
will-change: filter;
54+
transition: filter 300ms;
55+
}
56+
.logo:hover {
57+
filter: drop-shadow(0 0 2em #646cffaa);
58+
}
59+
.logo.vanilla:hover {
60+
filter: drop-shadow(0 0 2em #3178c6aa);
61+
}
62+
63+
.card {
64+
padding: 2em;
65+
}
66+
67+
.read-the-docs {
68+
color: #888;
69+
}
70+
71+
button {
72+
border-radius: 8px;
73+
border: 1px solid transparent;
74+
padding: 0.6em 1.2em;
75+
font-size: 1em;
76+
font-weight: 500;
77+
font-family: inherit;
78+
background-color: #1a1a1a;
79+
cursor: pointer;
80+
transition: border-color 0.25s;
81+
}
82+
button:hover {
83+
border-color: #646cff;
84+
}
85+
button:focus,
86+
button:focus-visible {
87+
outline: 4px auto -webkit-focus-ring-color;
88+
}
89+
90+
@media (prefers-color-scheme: light) {
91+
:root {
92+
color: #213547;
93+
background-color: #ffffff;
94+
}
95+
a:hover {
96+
color: #747bff;
97+
}
98+
button {
99+
background-color: #f9f9f9;
100+
}
101+
}

0 commit comments

Comments
 (0)