Automatic update from web-platform-tests webauthn: Implement cross-device fallback URL extension This adds basic support for the WebAuthn crossDeviceFallbackUrl extension, which allows Relying Parties to provide a fallback URL for cross-device (hybrid) authentication that the authenticator side will open in a browser if no credential was found. Intent to Prototype: https://groups.google.com/a/chromium.org/d/msgid/blink-dev/69fa1a08.2b0a0220.45bca.004a.GAE%40google.com Current spec PR: https://github.com/w3c/webauthn/pull/2380 Open issues: - Does not yet implement the CrossDeviceFallbackException that the spec introduces, since the authenticator side of that is underspecified. - Adds an client extension output, which the spec PR does not yet have, but WebAuthn requires of all client extensions. - Desktop implementation only for now. Bug: 509934168 TAG=agy CONV=e7793212-8326-42ba-a793-70924fe5d4b8" Link: https://chromium-review.googlesource.com/id/I314c75495071f9b707f08005782ad7ce6a6a6964 Bug: 09934168 Bug: 509934168 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7870585 Commit-Queue: Martin Kreichgauer <martinkr@google.com> Reviewed-by: Ken Buchanan <kenrb@chromium.org> Reviewed-by: Rick Byers <rbyers@chromium.org> Auto-Submit: Martin Kreichgauer <martinkr@google.com> Cr-Commit-Position: refs/heads/main@{#1636519} -- wpt-commits: fbdf562c74a858fef939425c2719facc7e133eeb wpt-pr: 60190
69 lines
1.9 KiB
HTML
69 lines
1.9 KiB
HTML
<!DOCTYPE html>
|
|
<meta charset="utf-8">
|
|
<title>getClientCapabilities tests</title>
|
|
<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>
|
|
"use strict";
|
|
|
|
const KNOWN_CAPABILITIES_SET = new Set([
|
|
"conditionalCreate",
|
|
"conditionalGet",
|
|
"hybridTransport",
|
|
"immediateGet",
|
|
"passkeyPlatformAuthenticator",
|
|
"relatedOrigins",
|
|
"signalAllAcceptedCredentials",
|
|
"signalCurrentUserDetails",
|
|
"signalUnknownCredential",
|
|
"userVerifyingPlatformAuthenticator",
|
|
|
|
// Extensions implemented by the client
|
|
"extension:appid",
|
|
"extension:appidExclude",
|
|
"extension:hmacCreateSecret",
|
|
"extension:credentialProtectionPolicy",
|
|
"extension:enforceCredentialProtectionPolicy",
|
|
"extension:minPinLength",
|
|
"extension:credProps",
|
|
"extension:largeBlob",
|
|
"extension:credBlob",
|
|
"extension:getCredBlob",
|
|
"extension:payment",
|
|
"extension:prf",
|
|
"extension:cmtgKey",
|
|
"extension:crossDeviceFallbackUrl",
|
|
]);
|
|
|
|
promise_test(async t => {
|
|
const capabilities = await PublicKeyCredential.getClientCapabilities();
|
|
|
|
const keys = Object.keys(capabilities);
|
|
const sortedKeys = [...keys].sort();
|
|
assert_array_equals(keys, sortedKeys, "Keys should be sorted lexicographically");
|
|
|
|
for (const key of keys) {
|
|
assert_equals(
|
|
typeof capabilities[key],
|
|
"boolean",
|
|
`Value for "${key}" should be boolean`
|
|
);
|
|
}
|
|
}, "Capabilities object has sorted keys and boolean values");
|
|
|
|
promise_test(async t => {
|
|
const capabilities = await PublicKeyCredential.getClientCapabilities();
|
|
|
|
for (const key of Object.keys(capabilities)) {
|
|
assert_true(
|
|
KNOWN_CAPABILITIES_SET.has(key),
|
|
`Capability "${key}" should be a known capability`
|
|
);
|
|
}
|
|
}, "Capabilities keys are known");
|
|
</script>
|