passwordless-id / webauthn

Webauthn / passkeys helper library to make your life easier. Client side, server side and demo included.
https://webauthn.passwordless.id
MIT License
436 stars 51 forks source link

Display QR code immediatly #32

Closed SourceCipher closed 1 year ago

SourceCipher commented 1 year ago

For some reason when I make a registration or login func, I get multiple popup windows appearing. First it asks me to always use USB key, no matter which options I will pass. If I press cancel then it shows another window to choose if I want to use tablet, phone etc and only when you select it displays qr code.

Is there any way to display that qr code as soon as the user presses the button? We know that the users will be using mobile phones always so these window popups are worthless for us and very confusing.

dagnelies commented 1 year ago

I don't think that's possible. The logic "how" and "what" appears is on the browser/platform side. All we can do is trigger whether we want to allow local/roaming or both authenticator types.

There is maybe (and it's a big maybe) a way to achieve that by playing around the allowed "transports" in the protocol or using some protocol extension, but I'm quite unsure of the result. It's also browser/platform specific, each one will show some slightly different behavior, is not very consistant and has changed several times over last year.

You can try to play around the native protocol if you want, and can gladly report your experience. Perhpas there is a way, dunno. Forcing the transports:["hybrid"] might be the best chance, but it's currently not overridable in this lib (all roaming authenticators are allowed for maximum compatibility instead)

SourceCipher commented 1 year ago

@dagnelies Ok thanks for the speedy answer! I will do my research and if I manage to do something close to that I will post the details here.

dagnelies commented 1 year ago

@SourceCipher any results?

SourceCipher commented 1 year ago

So far I cant find any information if its possible to make a dynamic qr code upon login in or registration without any popups coming up

dagnelies commented 1 year ago

@SourceCipher have you tried playing around with the transports property during registration? ...I also think the result might differ among browsers/platforms.

SourceCipher commented 1 year ago

No, not yet, I will have a look a bit later into it. And yes we tried with windows, mac and various browsers and result is different. Thats why its important for us to have that dynamic handling to make sure all the users have the same interaction

dagnelies commented 1 year ago

You are welcome to reopen this if you got some news.