-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebauthn.js
105 lines (100 loc) · 2.77 KB
/
webauthn.js
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
// https://opotonniee.github.io/webauthn-playground/
// https://webauthn.guide/#authentication
// creation
export const publicKeyCredentialCreationOptions = {
challenge: 'AAABeB78HrIemh1jTdJICr_3QG_RMOhp',
rp: {
origins: ['https://opotonniee.github.io'],
name: 'webauthn-playground',
},
pubKeyCredParams: [
{
type: 'public-key',
alg: -257,
},
{
type: 'public-key',
alg: -35,
},
{
type: 'public-key',
alg: -36,
},
{
type: 'public-key',
alg: -7,
},
{
type: 'public-key',
alg: -8,
},
],
excludeCredentials: [],
timeout: 120000,
authenticatorSelection: {
residentKey: 'preferred',
requireResidentKey: false,
userVerification: 'preferred',
},
attestation: 'none',
user: {
name: 'raidas',
displayName: 'Raidas',
id: 'cmFpZGFz',
},
}
export const credential = {
clientExtensionResults: {
credProps: {
rk: true,
},
thalesgroup_ext_v1: {
authenticatorDescription: {
friendlyName: 'X Linux x_',
},
},
thalesgroup_client_ext_v1: {
clientType: 1,
},
},
rawId: 'aUa_HtPHxr_JwcdWHSAweQ',
response: {
attestationObject:
'o2NmbXRkbm9uZWdhdHRTdG10oGhhdXRoRGF0YViUt8DGRTBfls-BhOH2QC404lvdhe_t2_NkvM0nQWEEADdZAAAAAOqbjWZNAR0hPOS2tIy1ddQAEGlGvx7Tx8a_ycHHVh0gMHmlAQIDJiABIVgg5O4qgyA83JJZJxUkoab83U5x5iSRU1ZVK0A4phUXm88iWCCh-pb0O2NjiTOpSldPlWnOIj_VutpQqeyHDe4SI58ftA',
clientDataJSON:
'eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiQUFBQmVCNzhIckllbWgxalRkSklDcl8zUUdfUk1PaHAiLCJvcmlnaW4iOiJodHRwczovL29wb3Rvbm5pZWUuZ2l0aHViLmlvIiwiY3Jvc3NPcmlnaW4iOmZhbHNlfQ',
transports: ['hybrid', 'internal'],
publicKeyAlgorithm: -7,
},
authenticatorAttachment: 'platform',
id: 'aUa_HtPHxr_JwcdWHSAweQ',
type: 'public-key',
}
// verification
export const publicKeyCredentialRequestOptions = {
challenge: 'EGYtAMgi8B2Ey1FNVfVF93m5LEz_CfwTy00W2zoPEN4',
timeout: 120000,
allowCredentials: [
{
type: 'public-key',
id: 'aUa_HtPHxr_JwcdWHSAweQ',
transports: ['hybrid', 'internal'],
},
],
userVerification: 'preferred',
}
export const assertion = {
clientExtensionResults: {},
rawId: 'aUa_HtPHxr_JwcdWHSAweQ',
response: {
authenticatorData: 't8DGRTBfls-BhOH2QC404lvdhe_t2_NkvM0nQWEEADcZAAAAAA',
signature:
'MEYCIQCIdvFH6dV7Kgv24u_ziXi3LvJyCL3NE-NWyTFf0II5GgIhALpjUGpEGse9j7UWg_CZba5bJkddgvnBV5sSbPCBYxOv',
userHandle: 'cmFpZGFz',
clientDataJSON:
'eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoiRUdZdEFNZ2k4QjJFeTFGTlZmVkY5M201TEV6X0Nmd1R5MDBXMnpvUEVONCIsIm9yaWdpbiI6Imh0dHBzOi8vb3BvdG9ubmllZS5naXRodWIuaW8iLCJjcm9zc09yaWdpbiI6ZmFsc2V9',
},
authenticatorAttachment: 'platform',
id: 'aUa_HtPHxr_JwcdWHSAweQ',
type: 'public-key',
}