-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebAuthN fails on localhost because it expects an HTTPS origin #6882
Comments
+1 since BitWarden jumps in ahead of native browser (why?) it stops all localhost development using WebAuthn being workable, unless in a browser where the BitWarden chrome extension has been disabled |
This also made me go insane debugging today to find out this was Bitwarden related and not my own WebAuthn code. Please at least update the error message so that it's easy to know that it is related to Bitwarden ;) |
I agree, after disabling BitWarden webauthn works as expected |
I just ran into this too. Seems like it's coming from clients/libs/common/src/vault/services/fido2/fido2-client.service.ts Lines 95 to 98 in a141890
There's a simple At the very least, maybe something like
|
If @barryp's solution is acceptable could we put this into a PR or is further consideration necessary? I have to enable & disable bitwarden when developing locally |
I might need some tweaking such as adding |
Hey, while I mostly work on Bitwarden passwordless.dev I'm just updating that we're looking to fix this in a way that aligns with the WebAuthn specification. |
This started being an issue for me today. |
Awesome. Any news on this? |
+1 this sucks ass |
@carlos-menezes and others: Since w3c/webauthn#2018 was merged in the spec we will move forward and allow Thanks for reporting this. |
Awesome, great to hear! |
Hey there! Thanks to @coroiu, this issue will be resolved pretty soon, but I have a workaround and I hope this becomes useful for some. I'm working on a project with Next.js and WebAuthn, and to bypass this limitation, I've created an HTTPS proxy for the development environment. If you want to try this workaround, first install dependencies by following command: npm i -D concurrently http-proxy And then create import fs from 'node:fs';
import path from 'node:path';
import proxy from 'http-proxy';
proxy
.createServer({
// openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -keyout localhost.key -out localhost.crt
ssl: {
key: fs.readFileSync(path.resolve('localhost.key')),
cert: fs.readFileSync(path.resolve('localhost.crt')),
},
target: {
host: 'localhost',
port: 3000,
},
ws: true,
})
.listen(3001); Now run the dev server by following command: concurrently --raw --kill-others "next dev" "node https-server.js" Also, make sure that |
@shahradelahi I haven't used Next.js in a while but it seems like they added experimental HTTPS support https://vercel.com/guides/access-nextjs-localhost-https-certificate-self-signed, could that also be a viable workaround while we wait for #9236 to get released? |
Steps To Reproduce
http
protocol)Expected Result
WebAuthN UI opens, mimicking browser behavior on localhost
Actual Result
WebAuthN fails silently on the UI but an error is logged to the console:
The error is correct, http://localhost is indeed not https, but I expected localhost to still be a valid origin.
Screenshots or Videos
No response
Additional Context
No response
Operating System
macOS
Operating System Version
No response
Web Browser
Chrome, Safari
Browser Version
Safari 17.0 and Arc 1.15.2
Build Version
Chromium Engine Version 119.0.6045.123 (arm64)
Issue Tracking Info
The text was updated successfully, but these errors were encountered: