Closed joaomelo closed 9 months ago
Hello @joaomelo, can you provide a couple more bits of info to help diagnose this?
cause
property on errors raised within startAuthentication()
that will be any error raised by the navigator.credentials.get()
call Hi @MasterKale.
Thank you very much for quickly responding; I updated the issue with more context. I hope I was as able to provide the information you requested.
Best regards. JM
Go to the local dev site (HTTP://192...***)
I'll bet this is the problem. WebAuthn can only be called from secure contexts which include:
Unfortunately you'll need to figure out how to get your dev instance available at one of those two forms of valid URLs - accessing it via IP address won't support use of WebAuthn.
ok @MasterKale. I will try to think of a way to overcome this use of the IP. thank you very much.
@joaomelo You can try ngrok for dev which will give you a valid https url and tunnel to your dev machine.
@joaomelo You can try ngrok for dev which will give you a valid https url and tunnel to your dev machine.
sure will @spendres, thank you.
For the record, I couldn't make it work with ngrok, but when I did a full publish to an internet environment, both registration and authentication went fine. Thanks again.
Closing this out as it seems resolved.
Describe the issue
When using the browser functions
startAuthentication
andstartRegistration
in mobile Chrome, an error message appears: "WebAuthn is not supported in this browser. " However, if the sitewebauthn.io
is accessed in the same browser, the site register and authenticate buttons function properly.Reproduction Steps
startRegistration
with the provided optionsI've tried registering on the desktop beforehand and only doing
startAuthetication
in the mobile environment. It still throws the same web auth not supported error withstartAuthentication
.Expected behavior
Since the webauthn.io site works, I expected the browser authenticator dialog would open for user interaction. When I use the system in the desktop browser, it works as expected.
Code Samples + WebAuthn Options and Responses
This is the code that calls
startRegistration
:Here an image capturing the call stack
If I click on the index.js link beside
startRegistration
, it jumps to this point in the the lib code:The webtuhn.io site prints data in the console when the authenticate button is pressed. I don't know if it is useful, but here it is:
Setting up Conditional UI (index):638 AUTHENTICATION OPTIONS (index):639 { "challenge": "Go6DqtLzqu555FuCi6evBkkLUxM7KjI8bpqODvqgOO6oOD1Rvbk2R9kRfbq-8WBNGvM9BWZoPca_CHPORukz0Q", "timeout": 60000, "rpId": "webauthn.io", "allowCredentials": [], "userVerification": "preferred" } (index):638 AUTHENTICATION OPTIONS (index):639 { "challenge": "kjgrKrnwd-sMjxeNkDe-6L0GGzwGydLPHQc3qnhmcbXnUibpUedKQxT-eP2Uti6qb0kuVF3W-RHI6e_y9CTujg", "timeout": 60000, "rpId": "webauthn.io", "allowCredentials": [], "userVerification": "preferred" } (index):428 Conditional UI request was aborted
Dependencies
SimpleWebAuthn Libraries
client is using: "@simplewebauthn/browser": "^9.0.1" and backend uses: @simplewebauthn/server": "8.3.5"
More Context
The server system is running on a local development machine. The local dev machine OS is Windows 11, but the system runs in the Ubuntu WSL2 environment. It is composed of multiple docker containers coordinated by docker-compose. The relevant services are an nginx entry point that proxies calls between the web server (single SPA Vue 2 app) or the authenticator backend microservice (NodeJS).
The nginx entry point answers at the HTTP://localhost address (no ports are required). Everything works as expected if we use the system from this same desktop machine.
To access the system from a phone, I opened my cell phone, connected it to the same Wi-Fi as the desktop machine, and typed the desktop IP address HTTP://192. .... The system is accessed, and I can navigate the first login steps normally. The error occurs in the step that
startAuthentication
is called.