[GH-ISSUE #332] Passkeys do not work #8224

Closed
opened 2026-04-13 03:19:20 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @KristjanVall on GitHub (Oct 25, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/332

Describe the bug
If i try to make passkey to create to my app it does not work. Also with better-auth demo app there also do not work it says failed to vertify

To Reproduce

  1. Add all the tutorial passkey things
  2.  <button
     onClick={async (e) => {
       const data = await passkey.addPasskey({});
     }}
    
     Passkey crate
    

Expected behavior
Should create passkey to db.

Screenshots
If applicable, add screenshots to help explain your problem.

Screenshot 2024-10-25 at 09 18 09

chrome and safari

This error accords when click to the

  <button
        onClick={async (e) => {
          const data = await passkey.addPasskey({});
        }}
      >
        Passkey create
      </button>
      Error: User verification required, but user could not be verified
    at verifyRegistrationResponse (webpack-internal:///(rsc)/./node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.js:139:15)
Originally created by @KristjanVall on GitHub (Oct 25, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/332 **Describe the bug** If i try to make passkey to create to my app it does not work. Also with better-auth demo app there also do not work it says failed to vertify **To Reproduce** 1. Add all the tutorial passkey things 2. <button onClick={async (e) => { const data = await passkey.addPasskey({}); }} > Passkey crate </button> **Expected behavior** Should create passkey to db. **Screenshots** If applicable, add screenshots to help explain your problem. <img width="607" alt="Screenshot 2024-10-25 at 09 18 09" src="https://github.com/user-attachments/assets/fbee0113-09ce-4164-9506-528c63e5ac1f"> chrome and safari This error accords when click to the ``` <button onClick={async (e) => { const data = await passkey.addPasskey({}); }} > Passkey create </button> ``` ``` Error: User verification required, but user could not be verified at verifyRegistrationResponse (webpack-internal:///(rsc)/./node_modules/@simplewebauthn/server/esm/registration/verifyRegistrationResponse.js:139:15) ```
GiteaMirror added the locked label 2026-04-13 03:19:20 -05:00
Author
Owner

@jabedzaman commented on GitHub (Nov 9, 2024):

got solution?

<!-- gh-comment-id:2466070856 --> @jabedzaman commented on GitHub (Nov 9, 2024): got solution?
Author
Owner

@afreidz commented on GitHub (Nov 26, 2024):

facing the same issue. i think it MIGHT be related to:

4e3e71c821/packages/better-auth/src/plugins/passkey/index.ts (L254)

and https://simplewebauthn.dev/docs/advanced/passkeys#verifyregistrationresponse

I would think that this may be worth parameterizing based on the simplewebauthn link ☝️ here. but i am not sure where having this in as a "preferred" value would cause this package to fail. 🤷

<!-- gh-comment-id:2502018111 --> @afreidz commented on GitHub (Nov 26, 2024): facing the same issue. i think it MIGHT be related to: https://github.com/better-auth/better-auth/blob/4e3e71c8212ea29199be00cfc9e0cbb24c27b1e5/packages/better-auth/src/plugins/passkey/index.ts#L254 and https://simplewebauthn.dev/docs/advanced/passkeys#verifyregistrationresponse I would think that this may be worth parameterizing based on the simplewebauthn link ☝️ here. but i am not sure where having this in as a "preferred" value would cause this package to fail. 🤷
Author
Owner

@afreidz commented on GitHub (Nov 26, 2024):

can confirm that flipping the requireUserVerification to false on the 2 methods simplewebathn mentions likely do not need user verification will bypass this error and allow the passkey plugin to work. I tested this on a fork here:

1316ab0054

I can submit a PR, but I think a better solution might be to parameterize this since there are SOME userland usecases where this may need to be NOT false. However, this presents the problem of finding the root cause of the user verification failing. Which would take more investigation. 🤷

@Bekacru any thoughts?

<!-- gh-comment-id:2502067746 --> @afreidz commented on GitHub (Nov 26, 2024): can confirm that flipping the `requireUserVerification` to `false` on the 2 methods simplewebathn mentions likely do not need user verification will bypass this error and allow the passkey plugin to work. I tested this on a fork here: https://github.com/afreidz/better-auth/commit/1316ab005494cf5863bf8f520fbf7b03c2331ac4 I can submit a PR, but I think a better solution might be to parameterize this since there are SOME userland usecases where this may need to be NOT false. However, this presents the problem of finding the root cause of the user verification failing. Which would take more investigation. 🤷 @Bekacru any thoughts?
Author
Owner

@Bekacru commented on GitHub (Nov 27, 2024):

@Bekacru any thoughts?

Yeah, I think parameterizing it makes sense. We can add an option for the plugin.

<!-- gh-comment-id:2504431016 --> @Bekacru commented on GitHub (Nov 27, 2024): > @Bekacru any thoughts? Yeah, I think parameterizing it makes sense. We can add an option for the plugin.
Author
Owner

@afreidz commented on GitHub (Nov 27, 2024):

Any ideas on why, if this is not explicitly set to false, the user verification would fail? I think that is the precursor to parameterizing it. I have yet to dig that deep into the internals of simplewebauthn/passkey authentication.

<!-- gh-comment-id:2504582960 --> @afreidz commented on GitHub (Nov 27, 2024): Any ideas on why, if this is not explicitly set to false, the user verification would fail? I think that is the precursor to parameterizing it. I have yet to dig that deep into the internals of simplewebauthn/passkey authentication.
Author
Owner

@Bekacru commented on GitHub (Nov 28, 2024):

I think it was just an oversight. We should default to "false" since userVerification is already set to "preferred." Also, we don't need to parametrize it for now, since that would require parametrizing "preferred" too. Feel free to open a PR.

<!-- gh-comment-id:2506096008 --> @Bekacru commented on GitHub (Nov 28, 2024): I think it was just an oversight. We should default to "false" since userVerification is already set to "preferred." Also, we don't need to parametrize it for now, since that would require parametrizing "preferred" too. Feel free to open a PR.
Author
Owner

@MasterKale commented on GitHub (Dec 8, 2024):

Hey all, I was poking around your issues looking for anything passkeys-related after seeing your project used SimpleWebAuthn (I'm its maintainer - hi! 👋)

Sometimes you'll come across an authenticator that will return uv:false when userVerification is "preferred". The best example I have of this is macOS and Touch ID when the laptop is in clamshell mode (closed but plugged in to external KB+M and monitor.) If UV is preferred then macOS will skip the system password prompt during WebAuthn and return uv:false. When the laptop is open and the user auths with that same passkey but uses Touch ID then you'll get back uv:true.

If you default to setting user verification to "preferred" in your auth options then, as I documented at that link you posted, I agree you should simply set requireUserVerification to false and move on. Just my $0.02 though ✌️

Edit: I see you already did that, so nice work, I think your users will be a lot happier 🎉

<!-- gh-comment-id:2525431064 --> @MasterKale commented on GitHub (Dec 8, 2024): Hey all, I was poking around your issues looking for anything passkeys-related after seeing your project used SimpleWebAuthn (I'm its maintainer - hi! 👋) Sometimes you'll come across an authenticator that will return uv:false when `userVerification` is "preferred". The best example I have of this is macOS and Touch ID when the laptop is in clamshell mode (closed but plugged in to external KB+M and monitor.) If UV is preferred then macOS will skip the system password prompt during WebAuthn and return uv:false. When the laptop is open and the user auths with that same passkey but uses Touch ID then you'll get back uv:true. If you default to setting user verification to "preferred" in your auth options then, as I documented at that link you posted, I agree you should simply set `requireUserVerification` to false and move on. Just my $0.02 though ✌️ Edit: I see you already did that, so nice work, I think your users will be a lot happier 🎉
Author
Owner

@afreidz commented on GitHub (Dec 8, 2024):

That's the exact scenario I was in. ☺️ Thanks for the confirmation!

<!-- gh-comment-id:2525577297 --> @afreidz commented on GitHub (Dec 8, 2024): That's the **exact** scenario I was in. ☺️ Thanks for the confirmation!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8224