-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
client.register() 'domain' option doesn't seem to work #81
Comments
To tell the truth, this option might indeed be buggy. It's the only option not properly tested😳. I'll need to dig into, but I'm short on time right now. |
At first sight, the registration correct but the verification is wrong. To test it, use another subdomain and it should be able to use the same passkeys. In other words, using a page on |
Thx for checking it out. Not a biggie to me, just thought I should report it. Started when my friend typed www.site.com into browser -- who does that anymore? I fixed that with a hammer by just redirecting www.domain to domain, but I can imagine some people would want to issue keys on www.site.com and have them be valid for site.com -- but maybe that's a security issue. Keys for site.com should work on sub.site.com, but not the other way around, correct? And www. is just a special case of that. p.s. Followed the discussion at w3c/webauthn#1749 and totally agree with you. It's obtuse that the API won't even give a passkey existence indicator for the selfsame web site. I have an id (browser_id = |
The default is fixed on the exact domain it is used. So that a passkey generated at "sub.example.com" is only valid for this subdomain, not "example.com" nor "child.sub.example.com". The |
Thank you for the clarification -- I think I get it now. And thank you for making this library. I shopped around, and yours is one of the cleanest (and not written by some company trying to sell some subscription-based passkey snakeoil;) |
Thanks for the kind words. I appreciate that a lot. |
Got this error on my server:
Error: Unexpected ClientData origin: https://www.lexluv.org
...when it was working fine without the www subdomain. Changed client code to:
Still get the same error. So, grabbed pk_registration.response.clientDataJSON:
"eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiV1RHa2FHVU9MUE5JU1VNOE45R1NjRTlZIiwib3JpZ2luIjoiaHR0cHM6Ly93d3cudHh0Z21zLmNvbSIsImNyb3NzT3JpZ2luIjpmYWxzZX0="
...decoded it to:
{"type":"webauthn.create","challenge":"WTGkaGUOLPNISUM8N9GScE9Y","origin":"https://www.lexluv.org","crossOrigin":false}
It would appear that register() is not acting on the 'domain' option at all. I note that the registration client data is using the 'origin', which includes the protocol. Maybe I'll look at the module source, but at a minimum the docs are wrong.
The text was updated successfully, but these errors were encountered: