AbortError
when calling startRegistration
on MacOS Safari
#389
Replies: 7 comments
-
In hindsight this might be the same as: #351 |
Beta Was this translation helpful? Give feedback.
-
Please fill out ALL of the issue template. "N/A" for sections not immediately relevant is fine, but omitting whole sections is no bueno. I created the template because it includes all of the common questions I have for people who drop an issue here, questions like "which browser and its version" and "which OS and version." Once that info is in there we can continue. |
Beta Was this translation helpful? Give feedback.
-
My apologies - I've filled out the additional sections. |
Beta Was this translation helpful? Give feedback.
-
Hmm, so while playing around with this I realized it's probably a bug with Safari, not with the example project. I recreated the issue in vanilla HTML + JS, the AbortError is expected but there's a <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<button id="startReg">Start modal registration</button>
<button id="startAuth">Start modal authentication</button>
<form action="">
<input
type="email"
name="email"
id="email"
autocomplete="webauthn username"
/>
</form>
<script>
const abortController = new AbortController();
// Start conditional UI
navigator.credentials
.get({
publicKey: {
challenge: new Uint8Array(16).fill(0),
allowCredentials: [],
},
mediation: "conditional",
signal: abortController.signal,
})
.then(console.log)
.catch(console.error);
// Start modal registration
document.getElementById("startReg").addEventListener("click", () => {
abortController.abort();
navigator.credentials.create({
publicKey: {
challenge: new Uint8Array(16).fill(0),
rp: { id: "localhost", name: "localhost" },
user: {
id: new Uint8Array(16).fill(0),
name: "Username",
displayName: "Username",
},
pubKeyCredParams: [{ alg: -7, type: "public-key" }],
},
});
});
// Start modal auth
document.getElementById("startAuth").addEventListener("click", () => {
navigator.credentials.get({
publicKey: {
challenge: new Uint8Array(16).fill(0),
},
});
});
</script>
</body>
</html> I'm going to log this as a bug with WebKit since Chrome handles this scenario as I'd expect. It might be the oddity of trying to call |
Beta Was this translation helpful? Give feedback.
-
I logged this as a bug here: https://bugs.webkit.org/show_bug.cgi?id=257176 Let's see what Apple says. |
Beta Was this translation helpful? Give feedback.
-
yeah definitely seems like Safari weirdness - observed it my own project initially. Thanks for logging that bug. |
Beta Was this translation helpful? Give feedback.
-
I'm going to convert this to a Discussion for now since it doesn't appear to be a library issue. |
Beta Was this translation helpful? Give feedback.
-
Describe the issue
When calling
startRegistration
in MacOS Safari anAbortError: Authentication ceremony was sent an abort signal
error occurs. Strangely, If called again it successfully starts the registration process.Reproduction Steps
Expected behavior
I would expect that it does not error the first time clicking 'Register'
Code Samples + WebAuthn Options and Responses
Can be replicated by running the example app locally.
Dependencies
SimpleWebAuthn Libraries
Additional context
Looks like it could be related to this issue maybe: #351
Beta Was this translation helpful? Give feedback.
All reactions