-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmock-oidc-landingpage.html
108 lines (104 loc) · 2.69 KB
/
mock-oidc-landingpage.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>DELEGATOR Mock OAuth2 Server</title>
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous"
/>
<style>
.presets-container {
margin-bottom: 20px;
}
.preset-btn {
margin: 0 5px 5px 0;
}
</style>
<script>
const presets = [
{
id: 'admin',
claims: {
email: 'm.musterfrau@mail.com',
family_name: 'Musterfrau',
given_name: 'Maria',
preferred_username: 'AdminUser',
locale: 'de',
'urn:zitadel:iam:org:project:275671427955294244:roles': {
admin: {}
}
}
},
{
id: 'user',
claims: {
email: 'm.mustermann@mail.com',
family_name: 'Mustermann',
given_name: 'Max',
preferred_username: 'NormalUser',
locale: 'de'
}
}
];
function selectPreset(preset) {
const usernameInput = document.querySelector('input[name="username"]');
const claimsTextarea = document.querySelector('textarea[name="claims"]');
usernameInput.value = preset.claims.preferred_username;
claimsTextarea.value = JSON.stringify(preset.claims, null, 2);
}
</script>
</head>
<body>
<div class="container">
<div class="row justify-content-md-center mt-5">
<div class="col-md-5">
<h4>MUNify DELEGATOR Mock OAuth2</h4>
<div class="presets-container">
<script>
presets.forEach((preset, index) => {
document.write(`
<button type="button"
class="btn btn-secondary btn-sm preset-btn"
onclick="selectPreset(presets[${index}])">
${preset.id}
</button>
`);
});
</script>
</div>
<form method="post">
<hr class="divisor" />
<div class="form-group">
<input
type="text"
class="form-control"
name="username"
autofocus="on"
placeholder="Enter any user/subject"
/>
</div>
<div class="form-group">
<textarea
class="form-control"
name="claims"
rows="15"
placeholder='Optional claims JSON value, example:
{
"acr": "reference"
}'
></textarea>
</div>
<div style="display: flex; justify-content: space-between">
<a href="http://localhost:5173" class="topBtn btn btn-error">Cancel</a>
<button type="submit" class="topBtn btn btn-primary">Sign-in</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>