forked from eparkko-lab/webauthn-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·291 lines (246 loc) · 16.4 KB
/
index.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<!DOCTYPE html>
<html style="background-color:#0b0c10;color:#45a29e">
<head>
<script src="./content/webauthn.js" type="text/javascript"></script>
<script src="./content/base64js/base64js-1.3.0.min.js" type="text/javascript"></script>
<script src="./content/requestBuilder.js" type="text/javascript"></script>
<script src="./content/view.js" type="text/javascript"></script>
<link href="./content/styles.css" rel="stylesheet" />
</head>
<body onload="setFromQueryParams()">
<p>WebAuthn API Playground</p>
<br>WebAuthn Request Type
<form>
<select name="webAuthnRequestTypeMenu" style="background-color: #c5c6c7" onchange="displayOptions()">
<option></option>
<option>get</option>
<option>create</option>
</select>
</form>
<br>
<div id="getOptions" style="display:none;background-color:#45a29e;color:#1f2833">
<table border="1">
<tr style="background-color:#1f2833; color:#45a29e">
<td>1. Pick your WebAuthn Request Options and Build</td>
<td>2. Modify your request. Call the authenticator.</td>
<td>3. See your WebAuthn Response.</td>
</tr>
<tr>
<td valign="top" class="menuHeadings">
<button onclick="buildGetRequest()">Build Get Request(using the options below)</button>
<br>
<br>
Create Random Challenge
<form>
<select style="background-color: #c5c6c7"
name="doGenerateRandomChallengeGetMenu">
<option selected>false</option>
<option>true</option>
</select>
</form>
<br>RP ID
<form>
<input style="background-color: #c5c6c7" type="text" name="rpIdGetMenu"
value="localhost">
</form>
<br>User Verification
<form>
<select name="userVerificationGetMenu"
style="background-color: #c5c6c7">
<option selected>preferred</option>
<option>required</option>
<option>discouraged</option>
<option>null</option>
</select>
</form>
<br>Timeout
<form>
<input type="text" name="timeoutGetMenu" value="15000"
style="background-color: #c5c6c7">
</form>
<br>AllowCredential.Id
<form>
<select name="allowCredentialsIdGetMenu" multiple
style="background-color: #c5c6c7">
<option>aaaaaaaaaaaaaaaaa</option>
<option>${lastGeneratedId}</option>
<option selected>null</option>
</select>
</form>
<br>AllowCredential.Transports
<form>
<select name="allowCredentialsTransportsGetMenu" multiple
style="background-color: #c5c6c7">
<option>nfc</option>
<option>usb</option>
<option>ble</option>
<option>internal</option>
<option selected>null</option>
</select>
</form>
</td>
<td valign="top">
<button onclick="authenticate()">Call WebAuthn Get(using the request below)</button>
<br>
<br>Here is your webauthn request
<br>
<textarea rows=35 cols=65 id="getBuilderArea"></textarea>
<br>
<br>
<button onclick="hide('webauthGetRequest')">Click Here To Show/Hide Encoded
WebAuthn
Request</button>
<textarea readonly rows=4 cols=65 id="webauthGetRequest"
style="display:none">Encoded WebAuthn Request</textarea>
</td>
<td valign="top">
<br>
<br>WebAuthn Response
<br>
<textarea readonly rows=35 cols=65 id="webauthGetResponse"></textarea>
</td>
</tr>
</table>
</div>
<div id="createOptions" style="display:none;background-color:#45a29e;color:#1f2833">
<table border="1">
<tr style="background-color:#1f2833; color:#45a29e">
<td>1. Pick your WebAuthn Request Options and Build</td>
<td>2. Modify your request. Call the authenticator.</td>
<td>3. See your WebAuthn Response.</td>
</tr>
<tr>
<td valign="top" class="menuHeadings">
<button onclick="buildCreateRequest()">Build Create Request(using the options below)</button>
<br>
<br>
Create Random Challenge
<form>
<select name="doGenerateRandomChallengeCreateMenu"
style="background-color: #c5c6c7">
<option selected>false</option>
<option>true</option>
</select>
</form>
<br>RP ID
<form>
<input type="text" name="rpIdCreateMenu" value="localhost"
style="background-color: #c5c6c7">
</form>
<br>User Verification
<form>
<select name="userVerificationCreateMenu"
style="background-color: #c5c6c7">
<option selected>preferred</option>
<option>required</option>
<option>discouraged</option>
<option>null</option>
</select>
</form>
<br>Authenticator Attachment
<form>
<select name="authenticatorAttachmentCreateMenu"
style="background-color: #c5c6c7">
<option selected>cross-platform</option>
<option>platform</option>
<option>null</option>
</select>
</form>
<br>Require Resident Key
<form>
<select name="requireResidentKeyCreateMenu"
style="background-color: #c5c6c7">
<option>null</option>
<option>true</option>
<option>false</option>
</select>
</form>
<br>Timeout
<form>
<input type="text" name="timeoutCreateMenu" value="15000"
style="background-color: #c5c6c7">
</form>
<br>Attestation
<form>
<select name="attestationCreateMenu" style="background-color: #c5c6c7">
<option selected>direct</option>
<option>indirect</option>
<option>none</option>
<option>null</option>
</select>
</form>
<br>Algorithm
<form>
<input type="text" name="algorithmCreateMenu" value="-7"
style="background-color: #c5c6c7">
</form>
<br>User.Name
<form>
<input type="text" name="userNameCreateMenu" value="Bobby@localhost"
style="background-color: #c5c6c7">
</form>
<br>User.Id (userHandle)
<form>
<input type="text" name="userIdCreateMenu" value="bbbbbbb"
style="background-color: #c5c6c7">
</form>
<br>User.DisplayName
<form>
<input type="text" name="userDisplayNameCreateMenu" value="bbbbbbb"
style="background-color: #c5c6c7">
</form>
<br>ExcludeCredentials.Id
(credentialId)
<form>
<select name="excludeCredentialsIdCreateMenu" multiple
style="background-color: #c5c6c7">
<option>aaaaaaaaaaaaaaaaa</option>
<option>${lastGeneratedId}</option>
<option selected>null</option>
</select>
</form>
<br>ExcludeCredentials.Transports
<form>
<select name="excludeCredentialsTransportsCreateMenu" multiple
style="background-color: #c5c6c7">
<option>nfc</option>
<option>usb</option>
<option>ble</option>
<option>internal</option>
<option selected>null</option>
</select>
</form>
</td>
<td valign="top">
<button onclick="register()">Call WebAuthn Create (using the request below)</button>
<br>
<br>Here is your webauthn request
<br>
<textarea rows=35 cols=65 id="createBuilderArea"></textarea>
<br>
<br>
<button onclick="hide('webauthCreateRequest')">Click Here To Show/Hide Encoded
WebAuthn Request</button>
<textarea readonly rows=4 cols=65 id="webauthCreateRequest"
style="display:none">Encoded WebAuthn Request
</textarea>
</td>
<td valign="top">
<br>
<br>WebAuthn Response
<br>
<textarea readonly rows=35 cols=65 id="webauthCreateResponse"></textarea>
</td>
</tr>
</table>
</div>
<div style="background-color:#0b0c10">
<br>
<button onclick="hide('history')">Click Here To Show/Hide History</button>
<div id="history" style="display:none">
<textarea readonly style="background-color:#0b0c10;color:#66fcf1" rows=10 cols=160
id="historyArea"></textarea>
</div>
</div>
</body>
</html>