summaryrefslogtreecommitdiffstats
path: root/dom/u2f/tests/frame_no_token.html
blob: 02e21bf8b7e55a84d020bfbd268cdf713e3b99ef (plain)
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
<!DOCTYPE html>
<meta charset=utf-8>
<head>
  <title>Test for FIDO Universal Second Factor No Token</title>
  <script src="u2futil.js"></script>
</head>
<body>

<script class="testbody" type="text/javascript">

var challenge = new Uint8Array(16);
window.crypto.getRandomValues(challenge);

var regRequest = {
  version: "U2F_V2",
  challenge: bytesToBase64UrlSafe(challenge),
};

local_expectThisManyTests(1);

u2f.register(window.location.origin, [regRequest], [], function (res) {
  local_isnot(res.errorCode, 0, "The registration should be rejected.");
  local_completeTest();
});

</script>

</body>
</html>