test_webauthn_in_xhtml.xhtml (1367B)
1 <?xml version="1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <title>Tests for WebAuthn in XHTML document for W3C Web Authentication</title> 6 <script src="/tests/SimpleTest/SimpleTest.js"></script> 7 <script type="text/javascript" src="u2futil.js"></script> 8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 9 </head> 10 <body> 11 <script class="testbody" type="text/javascript"> 12 "use strict"; 13 14 add_task(async () => { 15 await addVirtualAuthenticator(); 16 ok(true, "added virtual authenticator"); 17 18 let cred = await navigator.credentials.create({ 19 publicKey: { 20 rp: {id: document.domain, name: "none"}, 21 user: {id: new Uint8Array(), name: "none", displayName: "none"}, 22 challenge: crypto.getRandomValues(new Uint8Array(16)), 23 pubKeyCredParams: [{type: "public-key", alg: cose_alg_ECDSA_w_SHA256}], 24 } 25 }); 26 ok(true, "created credential"); 27 28 await navigator.credentials.get({ 29 publicKey: { 30 challenge: crypto.getRandomValues(new Uint8Array(16)), 31 allowCredentials: [{type: "public-key", id: cred.rawId}], 32 } 33 }); 34 ok(true, "asserted credential"); 35 }); 36 </script> 37 </body> 38 </html>