-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See https://w3c.github.io/webauthn/#enum-hints. This change adds support for RP hints on desktop, and disabled by default behind a flag. Bug: 1510305 Change-Id: I8aa4c31b644b02533778e5ed69c44bdaafaf0c14 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5108243 Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: Mike Taylor <miketaylr@chromium.org> Reviewed-by: Ken Buchanan <kenrb@chromium.org> Commit-Queue: Adam Langley <agl@chromium.org> Reviewed-by: Nina Satragno <nsatragno@chromium.org> Cr-Commit-Position: refs/heads/main@{#1237771}
- Loading branch information
1 parent
43f51a2
commit 9cc0bbf
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>WebAuthn createWithHints</title> | ||
<meta name="timeout" content="long"> | ||
<link rel="help" href="https://w3c.github.io/webauthn/#sctn-public-key-easy"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script src="helpers.js"></script> | ||
<script src="resources/utils.js"></script> | ||
<script> | ||
function testCreateWithHints() { | ||
"use strict"; | ||
|
||
// The 'hints' parameter affects UI, which cannot be tested with WPTs. | ||
// However, we can check that unknown values are ignored, as they | ||
// should be, and don't trigger an error. | ||
standardSetup(function() { | ||
promise_test(async t => { | ||
return createCredential({ | ||
options: { | ||
publicKey: { | ||
hints: ["not-a-defined-value"], | ||
}, | ||
}, | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
testCreateWithHints(); | ||
</script> | ||
</head> | ||
<body></body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>navigator.credentials.get() with hints</title> | ||
<meta name="timeout" content="long"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script src=helpers.js></script> | ||
<body></body> | ||
<script> | ||
standardSetup(async function() { | ||
"use strict"; | ||
|
||
const credPromise = createCredential(); | ||
|
||
// The 'hints' parameter affects UI, which cannot be tested with WPTs. | ||
// However, we can check that unknown values are ignored, as they | ||
// should be, and don't trigger an error. | ||
new GetCredentialsTest("options.publicKey.hints", ["not-a-defined-value"]) | ||
.addCredential(credPromise) | ||
.runTest("navigator.credentials.get with hints"); | ||
}, {}); | ||
</script> |